From ff98a569f30a02a8ae756914a98831900e684f58 Mon Sep 17 00:00:00 2001 From: cAptA1n-bot Date: Sat, 28 Mar 2026 10:51:35 +0530 Subject: [PATCH] Added salt definition in README.md Explained what is a salt in a hash. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 9a8588c..0691871 100644 --- a/README.md +++ b/README.md @@ -317,6 +317,15 @@ Resultant hashes will be 60 characters long and they will include the salt among - 16-byte (128-bit) salt, base64 encoded to 22 characters - 24-byte (192-bit) hash, base64 encoded to 31 characters +### What is a Salt? +A salt is a random value that is added to a password before hashing. + +It ensures that: +- The same password does not produce the same hash every time +- Precomputed attacks like rainbow tables become ineffective + +bcrypt automatically generates and stores the salt as part of the hash, so you do not need to manage it manually. + Example: ``` $2b$10$nOUIs5kJ7naTuTFkBy1veuK0kSxUFXfuaOKdOKf9xYT0KKIGSJwFa