Interface Scrypt.Lazy
- All Known Implementing Classes:
LazySodiumJava
- Enclosing interface:
- Scrypt
public static interface Scrypt.Lazy
-
Method Summary
Modifier and TypeMethodDescriptioncryptoPwHashScryptSalsa208Sha256(String password, long hashLen, byte[] salt, long opsLimit, long memLimit) Hash a password using a salt.cryptoPwHashScryptSalsa208Sha256Str(String password, long opsLimit, long memLimit) The most minimal way of hashing a given password using Scrypt.booleancryptoPwHashScryptSalsa208Sha256StrVerify(String hash, String password) Verifies a string that was hashed using Scrypt.
-
Method Details
-
cryptoPwHashScryptSalsa208Sha256
String cryptoPwHashScryptSalsa208Sha256(String password, long hashLen, byte[] salt, long opsLimit, long memLimit) throws SodiumException Hash 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
String cryptoPwHashScryptSalsa208Sha256Str(String password, long opsLimit, long memLimit) throws SodiumException The 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
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.
-