New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
You're storing user passwords and you know plain text is wrong, but installing bcrypt for a side project feels heavy.
What you'll have at the end
A hash-and-verify pair built on crypto.scrypt, with the cost numbers and the salt packed into one string alongside the hash so a login check can rebuild the exact same key later.
You need
A place in your signup and login code where you already have the plaintext password a user just typed, and a spot next to their other account fields to store one string.
Not covered
Argon2id, which current guidance ranks above scrypt, isn't part of every Node release the way scrypt is, so it takes a newer runtime or an outside package; this recipe sticks to what's already built in.
Checked 25 Aug 2026
Part of the Node.js cookbook