Both bcrypt and scrypt are intentionally slow password-hashing functions that resist brute-force attacks. Bcrypt's strength is widely understood and implemented across every major language. Scrypt adds memory-hardness — it requires large amounts of RAM as well as CPU time — making it significantly more expensive to attack with ASICs or FPGAs. All processing is done in your browser; no passwords leave your device.
Use bcrypt when you need broad library support and predictable hardware requirements. It is available in virtually every backend language and has a 20-year track record. Use scrypt when you are operating in a high-threat environment and can tolerate higher memory consumption per hash. Scrypt's memory requirement makes it substantially harder to parallelize with GPUs or custom hardware. Argon2 is a third option that combines time and memory hardness with better parameter control.
Scrypt's algorithm requires large contiguous blocks of memory (determined by the N and r parameters). An attacker who tries to use thousands of GPU cores cannot share that memory — each cracking attempt needs its own RAM allocation, drastically reducing parallelism.
The Node.js crypto module defaults are N=16384, r=8, p=1. OWASP recommends N=65536, r=8, p=1 as a minimum for high-security contexts. Benchmark on your target hardware to ensure response time stays under 1 second.
Unlike bcrypt (which truncates at 72 bytes), scrypt accepts arbitrary-length input through its underlying PBKDF2-SHA256 step. There is no practical length limit.
Only if your threat model requires memory-hardness. Bcrypt at cost 12 is still considered secure for most applications. Migrating requires a transition plan: re-hash existing passwords on next login.
See the All Hashes tool for non-password hashing, and the AES Cipher for symmetric encryption.
📖 Reference: OWASP Password Storage Cheat Sheet