crypto / org.apache.tuweni.crypto.sodium / PasswordHash / hashSensitive

hashSensitive

static fun hashSensitive(password: String, length: Int, salt: Salt): Bytes (source)
static fun hashSensitive(password: Bytes, length: Int, salt: Salt): Bytes (source)
static fun hashSensitive(password: ByteArray, length: Int, salt: Salt): ByteArray (source)

Compute a key from a password, using the currently recommended algorithm and limits on operations and memory that are suitable for sensitive use-cases.

Parameters

password - The password to hash.

length - The key length to generate.

salt - A salt.

Return
The derived key.

static fun hashSensitive(password: String, length: Int, salt: Salt, algorithm: Algorithm): Bytes (source)
static fun hashSensitive(password: Bytes, length: Int, salt: Salt, algorithm: Algorithm): Bytes (source)
static fun hashSensitive(password: ByteArray, length: Int, salt: Salt, algorithm: Algorithm): ByteArray (source)

Compute a key from a password, using limits on operations and memory that are suitable for sensitive use-cases.

Parameters

password - The password to hash.

length - The key length to generate.

salt - A salt.

algorithm - The algorithm to use.

Return
The derived key.

static fun hashSensitive(password: String): String (source)

Compute a hash from a password, using limits on operations and memory that are suitable for sensitive use-cases.

Equivalent to hash(password, sensitiveOpsLimit(), sensitiveMemLimit()).

Parameters

password - The password to hash.

Return
The hash string.