You have a bcrypt hash, saved from an earlier session or copied out of a database, and a password you believe matches it. The natural instinct is to look for the decrypt button, the thing that turns the hash back into the password so you can compare them directly. There is no such button, and there never can be. That is not a missing feature; it is the design.
Verification with bcrypt works the other way round. The hash string carries everything needed to repeat the original work, including the salt, so checking a password means doing the work again on the candidate and comparing outcomes. This guide explains that mechanism and walks through it with the free Bcrypt Hash Generator on Ovatly, which both creates bcrypt hashes and verifies passwords against them.
Contents
- Quick answer
- Why there is nothing to decrypt
- The salt is inside the hash
- How to verify a password, step by step
- Worked example: checking the example hash
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
To verify a password against a bcrypt hash: open the Bcrypt Hash Generator, paste the stored hash into the Verify section, type the candidate password, and run the check. The tool extracts the salt stored inside the hash, hashes your candidate with that salt at the cost recorded in the hash, and compares the result with the stored hash. You get one of two answers, match or no match. Nothing is decrypted at any point, and a malformed hash simply reads as a no-match.
Why there is nothing to decrypt
Encryption is a locked box: ciphertext goes in, and with the key the original comes back out. A hash is not a box at all. It is a one-way fingerprint of the input, and the only route from a hash back to a password is guessing: try a candidate, hash it, and see whether the result matches.
That sounds like a weakness until you see how login systems use it. A site never needs to recover your password. It needs to answer one question when you log in: is this the same password that produced the stored hash? Repeating the work and comparing answers that question completely, without the password ever being stored or recoverable. The same mechanism is what the Verify section performs for you manually.
The salt is inside the hash
bcrypt salts every password with fresh randomness, which raises an obvious question: if the salt is random and different every time, how can verification ever reproduce the result? The answer is that the salt is not kept secret or stored separately. It is written into the hash string itself, alongside the cost factor used.
Look at the opening of a real bcrypt hash: $2b$10$ records the format and a cost of 10, and the salt follows inside the same string. Verification extracts that salt automatically, hashes the candidate password with it at the recorded cost, and produces exactly the result the original run produced, provided the password is right. This is also why two hashes of one password look completely different yet both verify: each carries its own salt, and each check uses the salt it finds.
How to verify a password, step by step
- Open the Bcrypt Hash Generator and find the Verify section.
- Paste the complete stored hash. Copy all of it: a hash missing characters is a malformed hash, and it will read as a no-match whatever password you enter.
- Type the candidate password exactly as it was set, character for character.
- Run the check and read the verdict. Match means the candidate is the password that produced the hash. No match means it is not, or that the hash itself is malformed.
- If you expected a match and got a no-match, re-copy the hash in full and try once more before concluding the password is wrong. Most surprise no-matches are copying errors, not wrong passwords.
Worked example: checking the example hash
Hashing the phrase correct horse battery staple with bcrypt at cost 10 produced this result in one run:
$2b$10$jT61zASMuZO.BYMYrC8tVOrG4f70YI6WdfYJA2RvF4xQe9jYzcUa.
Now verify against it. Paste that hash into the Verify section and enter correct horse battery staple: the tool pulls the salt out of the string, re-hashes the phrase at cost 10, and the results agree, so the answer is match. Enter a wrong candidate, such as the same phrase with one word changed, and the re-hash produces a different result, so the answer is no match.
The part that surprises people: generate a fresh hash of the same phrase and you get a different string again, because the salt is new. Verify the phrase against that second hash and it still matches. The string changed; the relationship between password and hash did not, because the salt needed to check it travels inside each string.
Limitations and honest tradeoffs
bcrypt truncates input at 72 bytes, so two passwords that share the same first 72 bytes verify against the same hash; the tail simply does not take part. Verification also cannot tell you why a check failed: a malformed hash and a wrong password produce the same no-match, by design. And the answer is only ever about the pair you supplied. A match proves the candidate produced that hash; it says nothing about whether the password is a good one, only that it is the right one. In the generator side of the tool, the cost range is 4 to 12 with warnings at 11 and 12, while real applications commonly tune cost between 10 and 13 so one check takes roughly 250 milliseconds.
Common mistakes
- Looking for a decrypt option. There is none, for bcrypt or any real hash. Verification is the only direction the comparison can run.
- Assuming a different hash string means a different password. Fresh salt makes every hash of the same password unique. Different strings routinely belong to the same password.
- Pasting a partial hash. A copied hash that lost characters in transit is malformed, and malformed means no-match. Copy the full string and try again before doubting the password.
- Expecting an error message for a broken hash. The tool treats a malformed hash as a simple no-match rather than a separate error, so the verdict alone cannot distinguish a bad hash from a bad guess.
- Testing with a real password you still use. Verification is safe to run, but good practice is to rehearse with throwaway phrases, as the worked example does, and keep real credentials out of test sessions.
FAQs
Can a bcrypt hash be decrypted to reveal the password? No. bcrypt is a one-way hash, not encryption, and there is nothing to decrypt. Verification works by hashing the candidate password again, using the salt stored inside the hash, and comparing the two results.
Why does the same password give a different hash each time? Every run generates a fresh random salt, and the salt is mixed into the result. Because the salt is stored inside the hash string itself, verification can extract it and reproduce the identical result when the correct password is supplied.
What does a no-match result actually mean? One of two things: the password you entered is not the one that produced the hash, or the hash itself is malformed. The tool treats a malformed hash as a simple no-match rather than reporting a separate error, so check that the full hash was copied before concluding the password is wrong.
Does everything after a certain point in a password matter? bcrypt truncates input at 72 bytes, so characters beyond that point do not change the result. Two passwords sharing the same first 72 bytes produce and verify against the same hash.
Which parts of a bcrypt hash does verification use? The cost factor recorded in the hash and the salt stored inside it. In the worked example the cost is 10, the classic default. Verification re-runs the hashing at that cost with that salt, which is why no separate record of either value is ever needed.
Conclusion
Verifying a bcrypt hash is repetition, not reversal: extract the salt the hash carries, hash the candidate the same way, and compare. The Bcrypt Hash Generator does that in its Verify section, and the same two answers, match and no match, are all any login system ever gets or needs. For why bcrypt is built this way in the first place, and why its slowness is the point, read our comparison of bcrypt vs MD5 for passwords. For more guides in this series, see our Security and Privacy guides.
References
- OWASP Cheat Sheet Series, Password Storage Cheat Sheet, on verification by re-hashing with the stored salt: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html