Package net.overburn.redfort.keygen
Class Argon2KeyGenerator
java.lang.Object
net.overburn.redfort.keygen.Argon2KeyGenerator
- All Implemented Interfaces:
BasicKeyGenerator,SecretBasedKeyGenerator
Derives a suitable key from a secret/password, salt, extra secret for keyed hashing. Additional info can be used to tag. Implements
SecretBasedKeyGenerator
WARNING: Stick to Argon2KeyGenerator and avoid modifying/implementing this or any implementations without understanding the ramifications.
For more info see:- See Also:
-
Field Summary
Fields inherited from interface net.overburn.redfort.keygen.BasicKeyGenerator
AES, ARGON2, CHACHA20, DEFAULT_KEY_LENGTH, PBKDF2_WITH_HMAC_SHA_512 -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.overburn.redfort.keygen.BasicKeyGenerator
wrap, wrap
-
Constructor Details
-
Argon2KeyGenerator
public Argon2KeyGenerator()
-
-
Method Details
-
generate
- Specified by:
generatein interfaceSecretBasedKeyGenerator
-
generate
- Specified by:
generatein interfaceSecretBasedKeyGenerator
-
generate
- Specified by:
generatein interfaceSecretBasedKeyGenerator
-
generate
- Specified by:
generatein interfaceSecretBasedKeyGenerator
-
derive
public byte[] derive(char[] secret, byte[] salt, byte[] pepper, byte[] additional) Description copied from interface:SecretBasedKeyGeneratorDerives a suitable key from a secret/password, salt, extra secret for keyed hashing. Additional info can be used to tag.- Specified by:
derivein interfaceSecretBasedKeyGenerator- Parameters:
secret- secret or password that is supplied by user or server. Take utmost care.salt- Unique value for each secret that's known only to server for each secretpepper- Unique value for each secret that's known only to serveradditional- Any additional Tag for ID or classification- Returns:
- key that can be wrapped and supplied to Scrambler
-
wrap
-
wrap
-