Passwords

Example: Converting a password into a cryptographic key

The following code snippets are actually compiled and run during the BouncyGPG build process. This ensures that all examples are correct. Usage with Bouncy-GPGCryptographic key derivation functions should be used to derive a key from a password (or any other source material). Bouncy-GPG uses SCrypt for key stretching. The following snippet will derive a 256 bit key from a strong password. The derivation process is configured by SCryptKeyStretchingParameters.forStrongInputKeyMaterial(). This will give a very quick key derivation and is only secure because the password is very long and random. »