
Interview: How Do Websites Store Passwords?
How Websites Check Passwords Without Ever Storing Them!
Secure websites never actually know or store your real password in a database. Instead, they pass your password through a one-way hash function, which behaves like a digital blender: once scrambled into a unique string of characters, it can never be un-blended back into your original text. When you log in, the server simply hashes what you typed and checks if the resulting code matches the hash stored in its database. However, basic hashing has a dangerous flaw because identical passwords always produce identical hashes, allowing attackers with a leaked database to crack passwords by comparing them against trillions of pre-calculated hashes.
To prevent this, systems use a technique called salting. The server generates a unique random string for every account and attaches it to your password before hashing, ensuring that two users with the exact same password end up with completely different hashes. When you log in, the server retrieves your account's specific salt, mixes it back into your input, and recalculates the hash. To make brute-force cracking even more impossible, modern architectures ditch fast algorithms like SHA in favor of deliberately slow algorithms like Argon2 and bcrypt, making stolen data virtually useless to hackers.
#CyberSecurity #SoftwareEngineering #TechExplained #Coding #SystemDesign #WebDevelopment
Secure websites never actually know or store your real password in a database. Instead, they pass your password through a one-way hash function, which behaves like a digital blender: once scrambled into a unique string of characters, it can never be un-blended back into your original text. When you log in, the server simply hashes what you typed and checks if the resulting code matches the hash stored in its database. However, basic hashing has a dangerous flaw because identical passwords always produce identical hashes, allowing attackers with a leaked database to crack passwords by comparing them against trillions of pre-calculated hashes.
To prevent this, systems use a technique called salting. The server generates a unique random string for every account and attaches it to your password before hashing, ensuring that two users with the exact same password end up with completely different hashes. When you log in, the server retrieves your account's specific salt, mixes it back into your input, and recalculates the hash. To make brute-force cracking even more impossible, modern architectures ditch fast algorithms like SHA in favor of deliberately slow algorithms like Argon2 and bcrypt, making stolen data virtually useless to hackers.
#CyberSecurity #SoftwareEngineering #TechExplained #Coding #SystemDesign #WebDevelopment
KodeKloud
...