It is often necessary to derive an encryption key from a password. Passwords are easy for humans to remember whereas keys are needed in encryption schemes. A standard mechanism for performing a key derivation is given in RFC 2898.
Thanks to Felix Gartsman for pointing out a serious bug in version 1.0 Thanks to Thijs Van der Schaeghe for pointing out a bug in version 1.1 Thanks to Richard Gautier for asking to clarify dependencies in version 1.2 Updated contact information from version 1.3 Thanks to Stuart Heinrich for pointing out updates to PAJ's SHA-1 library in version 1.4 Current version: 1.5
Download the source code.