Pcornel
Security · Hashing

scrypt

Cheat sheet · https://pcornel.dk/topic.php?topic=4716

Back to the Topic

Answer

scrypt is a memory-hard password hashing and key derivation function, tuned with N, r and p parameters, designed to make large-scale hardware cracking costly.

Remember

  • scrypt is memory-hard.
  • It is tuned with N, r and p.
  • It resists GPU cracking well.

First checks

  • python3 -c "import hashlib;print(hashlib.scrypt(b'pw',salt=b'salt'*4,n=2**17,r=8,p=1).hex())" — scrypt example
  • Parameters N, r, p — memory/CPU cost
  • Memory available on servers — sizing

Verify in this order

password + salt + N,r,p → scrypt

Where it usually breaks

First mismatch in key/secret generation → storage/rotation → trust/certificate validation → protocol negotiation → cryptographic operation → peer/application verification; preserve identity/policy/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4716

Confirmation

Confirm action

Continue?