Package com.lambdaworks.crypto
Class PBKDF
- java.lang.Object
-
- com.lambdaworks.crypto.PBKDF
-
public class PBKDF extends java.lang.ObjectAn implementation of the Password-Based Key Derivation Function as specified in RFC 2898.
-
-
Constructor Summary
Constructors Constructor Description PBKDF()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]pbkdf2(java.lang.String alg, byte[] P, byte[] S, int c, int dkLen)Implementation of PBKDF2 (RFC2898).static voidpbkdf2(javax.crypto.Mac mac, byte[] S, int c, byte[] DK, int dkLen)Implementation of PBKDF2 (RFC2898).
-
-
-
Method Detail
-
pbkdf2
public static byte[] pbkdf2(java.lang.String alg, byte[] P, byte[] S, int c, int dkLen) throws java.security.GeneralSecurityExceptionImplementation 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:
java.security.GeneralSecurityException
-
pbkdf2
public static void pbkdf2(javax.crypto.Mac mac, byte[] S, int c, byte[] DK, int dkLen) throws java.security.GeneralSecurityExceptionImplementation of PBKDF2 (RFC2898).- Parameters:
mac- Pre-initializedMacinstance 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:
java.security.GeneralSecurityException
-
-