PBKDF2

io.github.nremond.PBKDF2$
object PBKDF2

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
PBKDF2.type

Members list

Concise view

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 210000 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.

Attributes

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