title: How to encrypt data in php using Public/Private keys?
body: <p>I have a small string of some data (less than 1kb) that I would like to have user agents pass to other sites when they are sent from my site. In order for the other sites to verify that I was the one that created the string I though of two options.</p>
  
  <ol>
  <li>The server pings me back to confirm (like paypal, openid, etc..)</li>
  <li>I use public/private keys to prove I sent the message (like PGP, DKIM, etc..)</li>
  </ol>
  
  <p>I don't want to setup HMAC because that would mean I have to use custom keys for each site which would be a pain. </p>
  
  <p>Out of those two choices it seems that #2 would save on bandwidth which makes it seem like a better choice.</p>
  
  <p><strong>So how can you setup public/private key cryptography using PHP and are there any downsides?</strong></p>