Package com.goterl.lazysodium.interfaces
Interface Scrypt.Lazy
-
- All Known Implementing Classes:
LazySodiumJava
- Enclosing interface:
- Scrypt
public static interface Scrypt.Lazy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringcryptoPwHashScryptSalsa208Sha256(java.lang.String password, long hashLen, byte[] salt, long opsLimit, long memLimit)Hash a password using a salt.java.lang.StringcryptoPwHashScryptSalsa208Sha256Str(java.lang.String password, long opsLimit, long memLimit)The most minimal way of hashing a given password using Scrypt.booleancryptoPwHashScryptSalsa208Sha256StrVerify(java.lang.String hash, java.lang.String password)Verifies a string that was hashed using Scrypt.
-
-
-
Method Detail
-
cryptoPwHashScryptSalsa208Sha256
java.lang.String cryptoPwHashScryptSalsa208Sha256(java.lang.String password, long hashLen, byte[] salt, long opsLimit, long memLimit) throws SodiumExceptionHash a password using a salt.- Parameters:
password- The password string to hash.hashLen- The length of the resulting hash. BetweenScrypt.SCRYPTSALSA208SHA256_BYTES_MINandScrypt.SCRYPTSALSA208SHA256_BYTES_MAX.salt- The salt to use.opsLimit- The number of cycles to perform whilst hashing. BetweenScrypt.SCRYPTSALSA208SHA256_OPSLIMIT_MINandScrypt.SCRYPTSALSA208SHA256_OPSLIMIT_MAX.memLimit- The amount of memory to use. BetweenScrypt.SCRYPTSALSA208SHA256_MEMLIMIT_MINandScrypt.SCRYPTSALSA208SHA256_MEMLIMIT_MAX.- Returns:
- The hashed password.
- Throws:
SodiumException- If the password could not be hashed.
-
cryptoPwHashScryptSalsa208Sha256Str
java.lang.String cryptoPwHashScryptSalsa208Sha256Str(java.lang.String password, long opsLimit, long memLimit) throws SodiumExceptionThe most minimal way of hashing a given password using Scrypt.- Parameters:
password- The password string to hash.opsLimit- The number of cycles to perform whilst hashing. BetweenScrypt.SCRYPTSALSA208SHA256_OPSLIMIT_MINandScrypt.SCRYPTSALSA208SHA256_OPSLIMIT_MAX.memLimit- The amount of memory to use. BetweenScrypt.SCRYPTSALSA208SHA256_MEMLIMIT_MINandScrypt.SCRYPTSALSA208SHA256_MEMLIMIT_MAX.- Returns:
- The hashed password
- Throws:
SodiumException- If the password could not be hashed.
-
cryptoPwHashScryptSalsa208Sha256StrVerify
boolean cryptoPwHashScryptSalsa208Sha256StrVerify(java.lang.String hash, java.lang.String password)Verifies a string that was hashed using Scrypt. This automatically adds a null byte at the end if there isn't one already.- Parameters:
hash- The hash with or without a null terminating byte.password- The password- Returns:
- True if the password 'unlocks' the hash.
-
-