Hash/Crittografia
Scrypt Hash + Verify
Applica l'hash alle password con scrypt (RFC 7914, KDF memory-hard) con verifica rispetto a un hash esistente.
Scrypt (RFC 7914) was one of the first memory-hard password-hashing algorithms: it deliberately requires a lot of RAM, not just CPU time, to make parallel brute-forcing on GPUs and ASICs harder.
How to use it
- Hash: enter a password and tune the parameters (N — memory cost, r — block size, p — parallelism) to get a hash.
- Verify: paste a password and an existing scrypt hash to check whether they match.
- Every hash uses a fresh random salt, so the same password produces a different hash each time.
Common uses
- Checking that a backend correctly hashes passwords with scrypt before storing them.
- Generating a test scrypt hash for fixtures or seed data during development.
- Comparing scrypt against bcrypt and Argon2 when choosing a hashing algorithm for a new project.
Things to keep in mind
The N parameter (memory cost) increases both required memory and compute time exponentially — tune it to your server's actual capacity.
Scrypt has been superseded by Argon2 (the official Password Hashing Competition winner) as the recommended choice for new systems, though scrypt itself still isn't considered unsafe.
Articolo su questo strumento: Scrypt: perché l'algoritmo ha bisogno di così tanta memoria
Domande frequenti
In cosa differisce scrypt da bcrypt o PBKDF2?
Scrypt è deliberatamente esigente sia in memoria che in CPU, rendendolo molto più costoso da violare con GPU o hardware ASIC personalizzato rispetto a bcrypt o PBKDF2, che resistono principalmente al brute-force basato su CPU.
Cosa controllano i parametri N, r e p?
N imposta il costo CPU/memoria (deve essere una potenza di due), r imposta la dimensione del blocco che influisce sull'uso della memoria per operazione, e p imposta la parallelizzazione — aumentare uno qualsiasi alza il costo delle risorse sia per l'uso legittimo che per gli attacchi.
scrypt è ancora una buona scelta rispetto ad Argon2?
Scrypt rimane solido e collaudato, ma Argon2 (vincitore della Password Hashing Competition) è generalmente consigliato per i nuovi sistemi, poiché offre un controllo più fine su memoria e resistenza agli attacchi side-channel.
Quanta memoria consuma davvero scrypt?
Circa 128 × N × r byte per singolo calcolo. Con parametri tipici (N=16384, r=8) sono circa 16 megabyte per hash — trascurabile per un singolo login, ma significativo con migliaia di autenticazioni simultanee sul server.
Dove viene usato scrypt oltre all'hashing delle password?
Scrypt è noto come algoritmo di proof-of-work in alcune criptovalute (ad esempio Litecoin) — è stato scelto proprio per la resistenza al mining su dispositivi ASIC specializzati, tipica di bitcoin con il suo SHA-256.