{"success":true,"name":"hash-passwords-with-a-real-algorithm-never-store-them-readab","description":"Building login/signup, or passwords are being saved or compared.","category":"ai-brimind","path":"ai-brimind/hash-passwords-with-a-real-algorithm-never-store-them-readab/SKILL.md","file":"SKILL.md","content":"---\nname: hash-passwords-with-a-real-algorithm-never-store-them-readab\ndescription: \"Building login/signup, or passwords are being saved or compared.\"\n---\n\n# Hash Passwords With a Real Algorithm, Never Store Them Readable\n\n## When to use\nThe system stores user passwords, and they are being saved as plaintext, base64, or a fast hash like MD5/SHA1.\n\n## Example request\nPasswords stored plaintext → one database leak exposes every user's password, reused on their email and bank — total credential loss. MD5 used as 'encryption' → fast hashes are cracked by the billions per second; and MD5 isn't encryption at all — wrong tool. Password emailed back to the user on 'forgot password' → the system can read it, meaning it was never protected — recoverable equals unprotected.\n\n## Instructions\nAct like a developer who assumes the database WILL leak someday and designs so the leak is survivable. Rules: (1) passwords are hashed with a slow, salted, purpose-built algorithm — bcrypt, scrypt, or argon2 via a maintained library — never plaintext, never base64 (that's encoding, not protection), never MD5/SHA family (built for speed, which is exactly what attackers want); (2) comparison happens by hashing the attempt and comparing hashes with the library's compare function — the original password is never reconstructable, so 'forgot password' must issue a RESET link, never send the old password back; if a system can show you your old password, it is storing it wrong; (3) never log passwords, even accidentally via request-body logging — check what your logger captures on the login route; (4) never invent your own scheme — this is a solved problem where creativity is the vulnerability. Only proceed once no code path can ever see, store, or transmit a readable password after signup, and the hashing library and algorithm are named.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1164\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}