Package com.lambdaworks.crypto
Class PBKDF
java.lang.Object
com.lambdaworks.crypto.PBKDF
An implementation of the Password-Based Key Derivation Function as specified
in RFC 2898.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PBKDF
public PBKDF()
-
-
Method Details
-
pbkdf2
public static byte[] pbkdf2(String alg, byte[] P, byte[] S, int c, int dkLen) throws GeneralSecurityException Implementation of PBKDF2 (RFC2898).- Parameters:
alg
- HMAC algorithm to use.P
- Password.S
- Salt.c
- Iteration count.dkLen
- Intended length, in octets, of the derived key.- Returns:
- The derived key.
- Throws:
GeneralSecurityException
-
pbkdf2
public static void pbkdf2(Mac mac, byte[] S, int c, byte[] DK, int dkLen) throws GeneralSecurityException Implementation of PBKDF2 (RFC2898).- Parameters:
mac
- Pre-initializedMac
instance to use.S
- Salt.c
- Iteration count.DK
- Byte array that derived key will be placed in.dkLen
- Intended length, in octets, of the derived key.- Throws:
GeneralSecurityException
-