yescrypt
An scrypt-derived memory-hard password hash, now the default in many Linux distributions
About yescrypt
yescrypt is a password hashing function. It uses a 16–1,024-byte output and a 0–64-byte salt. It takes the parameters ln (default 14), out_len (default 32), p (default 1) and r (default 8). Its registry entry cites yescrypt (PHC finalist; Peslyak), YESCRYPT_DEFAULTS flavour. NextSSL lists it in the standard tier and exposes it through the safe API.
Overview
yescrypt is a password hashing scheme by Alexander Peslyak (Solar Designer) that extends scrypt. It received special recognition in the Password Hashing Competition and has become the default password hash in /etc/shadow on several major Linux distributions.
yescrypt keeps scrypt's overall structure and remains scrypt-compatible with certain flags, but replaces the BlockMix core with pwxform, a function that performs small random-access lookups into S-boxes held in fast memory. This makes attacks on GPUs and other parallel hardware more expensive because they must replicate both large memory and fast small lookups. Optional features include pre-hashing with a large ROM and hash upgrades without the original password.
NextSSL implements yescrypt with the YESCRYPT_DEFAULTS flags, the configuration used by libxcrypt in modular-crypt $y$ hashes. Hashes in this format begin with '$y$' and include encoded parameters and salt, so they can be stored directly in /etc/shadow and verified by any compatible libxcrypt build. Debian, Fedora and Ubuntu moved to yescrypt as the default in recent releases.
History
2013–2015Password Hashing Competition announced
Password Hashing Competitionyescrypt published by Alexander Peslyak (Solar Designer)
24 candidates submitted; nine finalists named in December
Password Hashing CompetitionReceived special recognition in the Password Hashing Competition
Security notes
No weaknesses in yescrypt are known. Like scrypt, it uses data-dependent memory access, which can leak through cache timing on shared hardware. Its specification is a single implementation rather than an RFC.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 16 – 1,024 | Output |
| salt | 0 – 64 | Salt |
Parameters
| Name | Type | Range | Default | Required |
|---|---|---|---|---|
| ln | u32 | 2 – 20 | 14 | no |
| out_len | u32 | 16 – 1024 | 32 | no |
| p | u32 | 1 – 16 | 1 | no |
| r | u32 | 1 – 32 | 8 | no |
| t | u32 | 0 – 255 | 0 | no |
Parameters are passed as a string, for example nextssl_mac("hmac", "hash=sha512", …). Omitted parameters take their declared default.
Use it
from nextssl_demo import NextSSL
ns = NextSSL() # safe API: safe and standard tiers
phc = ns.call("pwhash", "yescrypt", None, b"correct horse")[0] # PHC string, fresh salt
ok = ns.check("pwhash_verify", "yescrypt", None, b"correct horse", phc)
nextssl_pwhash("yescrypt", NULL, password, out);
nextssl_pwhash_verify("yescrypt", NULL, password, phc);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_pwhash_in(reg::all(), Policy::Safe, "yescrypt", &Params::new())?;
let phc = alg.hash(b"correct horse")?; // PHC string
let ok = alg.verify(b"correct horse", &phc)?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other yescrypt variants
1Similar names
Looking for something else?More password hashing
All 30Frequently asked questions
What is yescrypt?
yescrypt is a password hash in the yescrypt family. yescrypt is a password hashing scheme by Alexander Peslyak (Solar Designer) that extends scrypt.
What are the yescrypt sizes?
In NextSSL, yescrypt uses: output 16 to 1,024 bytes.
Who designed yescrypt and when?
yescrypt belongs to the yescrypt family, first published in 2014 by Alexander Peslyak (Solar Designer). Its origin: Password Hashing Competition finalist (special recognition).
Which standards define yescrypt?
yescrypt is referenced by yescrypt (PHC finalist; Peslyak), YESCRYPT_DEFAULTS flavour.
Is yescrypt safe to use?
yescrypt is in the standard tier. Standardised and sound. Reachable from the safe API. It can be called from the safe API.
What other yescrypt variants are there?
NextSSL also registers yescrypt-phc in the yescrypt family.