PBKDF2

object PBKDF2
class Object
trait Matchable
class Any
PBKDF2.type

Value members

Concrete methods

def apply(password: Array[Byte], salt: Array[Byte], iterations: Int, dkLength: Int, cryptoAlgo: String): Array[Byte]

Implements PBKDF2 as defined in RFC 2898, section 5.2

Implements PBKDF2 as defined in RFC 2898, section 5.2

HMAC+SHA256 is used as the default pseudo random function.

Right now 120000 iterations is the strictly recommended default minimum. https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2 The minimum increases every year, please keep that in mind.

Value parameters:
cryptoAlgo

HMAC+SHA512 is the default and note that HMAC+SHA1 is now considered weak

dkLength

derived-key length

iterations

the number of encryption iterations

password

the password to encrypt

salt

the NIST recommends salt that is at least 128 bits(16 bytes) long (http://csrc.nist.gov/publications/nistpubs/800-132/nist-sp800-132.pdf)

Returns:

the hashed password