name.neuhalfen.projects.crypto.symmetric.keygeneration.impl.stretching.KeyStretching Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bouncy-gpg Show documentation
Show all versions of bouncy-gpg Show documentation
Make using Bouncy Castle with OpenPGP fun again!
The newest version!
package name.neuhalfen.projects.crypto.symmetric.keygeneration.impl.stretching;
import java.security.GeneralSecurityException;
/**
* Encapsulates a key derivation function that stretches (strengthens) the key.
*
* Examples for key stretching functions are SCrypt and PBKDF.
*
* An implementation *instance*:
*
* * must derive deterministically (always return the same key for the same input)
* * may include other data in the derived key (e.g. an inherent salt)
*
* Different *instances* may:
* * derive a different key
*
* Further Reading:
* * Key stretching on Wikipedia.
* * NIST
* Special Publication 800-132: Recommendation for Password-Based Key Derivation
* * Key derivation function
* on Wikipedia.
*/
public interface KeyStretching {
byte[] strengthenKey(byte[] salt, byte[] keyToStrengthen, int desiredKeyLengthInBits)
throws GeneralSecurityException;
}