- java.lang.Object
-
- org.cryptomator.cryptolib.common.Scrypt
-
public class Scrypt extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]scrypt(byte[] passphrase, byte[] salt, int costParam, int blockSize, int keyLengthInBytes)Derives a key from the given passphrase.static byte[]scrypt(CharSequence passphrase, byte[] salt, int costParam, int blockSize, int keyLengthInBytes)Derives a key from the given passphrase.
-
-
-
Method Detail
-
scrypt
public static byte[] scrypt(CharSequence passphrase, byte[] salt, int costParam, int blockSize, int keyLengthInBytes)
Derives a key from the given passphrase. This implementation makes sure, any copies of the passphrase used during key derivation are overwritten in memory asap (before next GC cycle).- Parameters:
passphrase- The passphrase, whose characters will get UTF-8 encoded during key derivation.salt- Salt, ideally randomly generatedcostParam- Cost parameterN, larger than 1, a power of 2 and less than2^(128 * blockSize / 8)blockSize- Block sizerkeyLengthInBytes- Key output lengthdkLen- Returns:
- Derived key
- See Also:
- RFC 7914
-
scrypt
public static byte[] scrypt(byte[] passphrase, byte[] salt, int costParam, int blockSize, int keyLengthInBytes)Derives a key from the given passphrase. This implementation makes sure, any copies of the passphrase used during key derivation are overwritten in memory asap (before next GC cycle).- Parameters:
passphrase- The passphrase,salt- Salt, ideally randomly generatedcostParam- Cost parameterN, larger than 1, a power of 2 and less than2^(128 * blockSize / 8)blockSize- Block sizerkeyLengthInBytes- Key output lengthdkLen- Returns:
- Derived key
- See Also:
- RFC 7914
-
-