title: What is the best way to encrypt a very short string in PHP?
body: <p>I would like to encrypt strings which could potentially only be about three or four characters but run to about twenty characters. A hashing function (<a href="http://www.php.net/md5" rel="noreferrer">md5</a>, <a href="http://www.php.net/sha1" rel="noreferrer">sha1</a>, <a href="http://www.php.net/crypt" rel="noreferrer">crypt</a> etc) is not suitable as I would like to be able to decrypt the information as well. The <a href="http://au.php.net/mcrypt" rel="noreferrer">mcrypt</a> extension has a thoroughly daunting array of possibilities. </p>
  
  <p>Does anyone have any ideas about the best way to safely encrypt short strings and <em>why</em>? Does anyone have any links to any material introducing a casual programmer to practical encryption scenarios?</p>