Protected ReadonlyoptionsStatic ReadonlyITERATIONSStatic ReadonlyKEY_Static ReadonlyLEGACY_Static ReadonlyLEGACY_Static ReadonlyLEGACY_Static ReadonlyPREFIXStatic ReadonlySALT_ProtectedisProtectedlegacyThe text the crypto-js implementation stored (before the optional base64): salt + hex key.
ProtectedmatchesProtectedmatchesWhether a stored hash should be replaced by encode() of the password once it matched (a legacy
format, or weaker parameters than new hashes get). Login does so when the UserService can
store passwords (UserService.updatePassword).
Protectedpepper
Password hashes with PBKDF2-HMAC-SHA256 on node:crypto, compared in constant time.
New hashes:
pbkdf2-sha256$<iterations>$<salt, base64>$<key, base64>with 600000 iterations, a 16-byte random salt (followed by the UTF-8 bytes ofsecretwhen one is set) and a 32-byte key.Legacy hashes (no prefix), as the crypto-js 4.2.0 implementation of 4.x stored them, keep matching: optionally base64 of a text that is a 16-character hex salt followed by the hex key; the key is PBKDF2(password, salt + String(secret)) with SHA-256,
iterations(default 250000) andkeySizewords (default 4). Without a secret the salt text ends inundefined, which is how those hashes were made. Hashes made with crypto-js 4.1 or older (SHA-1, 1 iteration) are not supported. needsUpgrade is true for legacy hashes, so a login replaces them with a new hash.