title: Utilizing PBKDF2 with OpenSSL library
body: <p>I want to utilize the PBKDF2 algorithm with SHA1 HMAC (based on <a href="https://security.stackexchange.com/a/31846/5997">this</a> answer).</p>
  
  <p>How can I utilize this through the crypto library?</p>
  
  <p>I started by looking at <code>man openssl</code>, but the <code>openssl passwd</code> command (<a href="http://www.openssl.org/docs/apps/passwd.html" rel="nofollow noreferrer">man page</a>) only supports a small handful of algorithms. Looking at the <a href="http://www.openssl.org/docs/crypto/crypto.html" rel="nofollow noreferrer">crypto</a> documentation, the <a href="http://www.openssl.org/docs/crypto/evp.html" rel="nofollow noreferrer">evp</a> module has an <a href="http://www.openssl.org/docs/crypto/EVP_BytesToKey.html" rel="nofollow noreferrer">EVP_BytesToKey</a> method.</p>
  
  <blockquote>
    <p>Careful selection of the parameters will provide a PKCS#5 PBKDF1 compatible implementation. However, new applications should not typically use this (preferring, for example, PBKDF2 from PCKS#5).</p>
  </blockquote>
  
  <p>Which brings me back to my original question, how do I utilize PBKDF2 via crypto? Do I need to dig into the code and call a non-API-exposed method (such as <a href="http://cvs.openssl.org/fileview?f=openssl/crypto/evp/p5_crpt2.c&amp;v=1.25.4.3" rel="nofollow noreferrer">PKCS5_PBKDF2_HMAC</a>)? (and if so, what's keeping it from being exposed?)</p>