Package com.mku.salmon.password
Class SalmonDefaultPbkdfProvider
java.lang.Object
com.mku.salmon.password.SalmonDefaultPbkdfProvider
- All Implemented Interfaces:
ISalmonPbkdfProvider
Provides pbkdf algorithm.
-
Field Summary
Fields inherited from interface com.mku.salmon.password.ISalmonPbkdfProvider
PBKDF_SHA1, PBKDF_SHA256
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
SalmonDefaultPbkdfProvider
public SalmonDefaultPbkdfProvider()
-
-
Method Details
-
getKey
public byte[] getKey(String password, byte[] salt, int iterations, int outputBytes, PbkdfAlgo pbkdfAlgo) Get a key derived from a text password- Specified by:
getKey
in interfaceISalmonPbkdfProvider
- Parameters:
password
- The text password.salt
- The salt needs to be at least 24 bytes.iterations
- Iterations to use. Make sure you use a high number according to your hardware specs.outputBytes
- The length of the output key.pbkdfAlgo
- The PBKDF algorithm to use- Returns:
- The key.
- Throws:
SalmonSecurityException
- Thrown if there is a security exception
-