Q47: Why is scrypt preferred over MD5 or SHA256 for user password hashing in Node.js?
MD5 and SHA256 are fast cryptographic hashing algorithms designed for high-throughput checksum generation, making them vulnerable to rapid GPU hardware brute-force attacks. crypto.scrypt() is a memory-hard key derivation function deliberately designed to consume significant memory and CPU time, making hardware-accelerated brute-force cracking attempts impractical.
Key Takeaways
- Fast hash functions (SHA256, MD5) are vulnerable to GPU brute-force attacks.
scryptimposes memory and CPU computational costs to defend against password cracking.
Knowledge Check
What design trait makes crypto.scrypt() resilient against specialized GPU cracking hardware?