📖 What is Salt (Cryptography)?
Salt is a random string of characters added to a password before it is hashed to protect against rainbow table attacks. By ensuring that identical passwords result in different hashes, salting makes it computationally expensive for attackers to crack passwords using pre-computed tables.
"Do not confuse salting with peppering; salts are typically stored in the database alongside the hash, while peppers are stored in a separate secure location."
📚 Certification: CompTIA Security+ Certification Exam (SY0-701)
🔑 What are the Key Concepts of Salt (Cryptography)?
- ▸ Prevents rainbow table attacks by ensuring that pre-computed hash tables cannot be used to quickly reverse password hashes into plain text.
- ▸ Requires a unique salt for every user to ensure that identical passwords result in different hash values within the database.
- ▸ Stored in plain text within the database alongside the resulting hash, as the salt is required to verify the password during login.
- ▸ Forces attackers to perform brute-force attacks on a per-user basis rather than attacking the entire password database simultaneously.
🎯 How does Salt (Cryptography) appear on the SY0-701 Exam?
You may be asked to identify the best method to protect a database of hashed passwords from rainbow table attacks when identical passwords are producing identical hashes.
A scenario might describe a security audit where salts are stored in the database but a secret key is stored in a hardware security module, asking you to distinguish between salting and peppering.
❓ Frequently Asked Questions
If salts are stored in plain text in the database, doesn't that make them useless to an attacker?
No, because the salt's purpose is not to be a secret, but to ensure uniqueness. It prevents the use of global pre-computed tables, forcing the attacker to compute hashes for each specific salt.
How does salting differ from key stretching techniques like bcrypt?
Salting prevents rainbow table attacks by adding uniqueness. Key stretching intentionally slows down the hashing process using multiple iterations, making brute-force and dictionary attacks computationally expensive.