Node.jsQuestion 17 of 26
Hashing and encryption
Answer out loud or in your head first, then compare.
Answer
I separate three uses: encrypting data, checking its integrity and storing passwords.
Encryption is reversible with a key, e.g. AES-GCM. A hash is one-way; HMAC lets you check integrity using a secret.
Passwords: I use an algorithm designed for them, e.g. Argon2id, with a unique salt and a suitable cost. Plain SHA-256 is too fast for storing passwords.
Pitfall: Base64 is an encoding, not encryption. I don't design my own cryptography. When asked which algorithms I've used, I describe only the ones I've actually worked with.
How did it go? Be honest — “Not yet” puts the question on your review list.