title: Choosing a portable encryption library
body: <p>I am developing a utility that, among other things, encrypts data using a pass-phrase supplied by the user. I don't have much experience writing good and portable code so I am trying to learn how to do it well. What is the best library to use to perform hashing and encryption functions?</p>
  
  <p>To clarify, I'm not looking for a library with the best functionality, I am looking for a library which is available on most operating systems and commonly installed on many. I know I'm not going to find a library that is installed by default on most operating systems, but I would like to pick one that provides the easiest installation for the majority of users.</p>
  
  <p>I have looked at vanilla installations of Windows 7 (Cygwin), Mac OS X 10.8, Debian 6.0.5, and Ubuntu 12.04.1 LTS and the only thing they all have in common is <code>crypt</code> which I understand is not recommended due to using a weak encryption algorithm with a limited key size.</p>
  
  <p>At the moment I am considering using <code>libmcrypt</code> and <code>mhash</code> as these are available via aptitude on both Debian and Ubuntu (and from what I can tell most other distributions of Linux), can be installed on Mac OS X via MacPorts or Homebrew, and are available in the Cygwin installer for Windows. They are also available for FreeBSD, OpenBSD, and NetBSD.</p>
  
  <p>I would very much appreciate some help in choosing the best library to use, as well as pointing out other factors that I may not have considered.</p>