How to use
- The tool opens on the Hash tab. Type or paste your string into String to hash — if it runs past 72 bytes a note appears, because bcrypt only reads that far.
- Set the Cost factor slider anywhere from 4 to 15. The label recalculates live, so cost 13 reads as 8,192 rounds.
- Press Generate hash. A percentage ticks upward while it runs, then the status line reports the cost and the real elapsed time — for instance “Hashed at cost 13 in 640 ms”.
- Use Copy above the output to grab the 60-character result.
- To check an existing hash, switch to the Verify tab, paste the plaintext and the hash, and press Verify. A badge shows Match or No match alongside the cost it read out of the hash.
How it works
bcrypt is an adaptive hash built on the key schedule of the Blowfish cipher. The expensive part is deliberate: setting up a Blowfish key normally happens once, but bcrypt repeats that setup 2^cost times, folding the salt and your string back in on every pass. Doubling the cost therefore doubles the work — and a routine that is instant to run once becomes punishing to run a few billion times.
Here is one pass. Take the string violet-otter-Cove-9 at cost 12. The tool draws 16 random bytes from the browser’s CSPRNG through a single audited helper — the same source explained in our CSPRNG vs Math.random guide — encodes them into a 22-character salt, and hands both to bcryptjs. Because the salt is random, the 60-character output differs on every run, such as:
$2b$12$Qw8Zl3Rk9fBxY0uVsC2aOe7pM1nD4hT6gJ5kL0rS3vU8wX2yZ1bCk
Split it into four parts: $2b$ is the version tag, 12 is the cost, the next 22 characters (Qw8Zl3Rk9fBxY0uVsC2aOe) are the salt, and the final 31 (7pM1nD4hT6gJ5kL0rS3vU8wX2yZ1bCk) are the digest. Salt and digest are carried together, which is how the Verify tab re-runs the algorithm without you supplying either by hand.
Use cases & limitations
You’ll want this while learning how bcrypt behaves, timing a cost factor on your own hardware before you commit to it in a login flow, or checking a hash you already hold — one lifted from a database export or a seed file — against a plaintext you suspect produced it. If instead you want a fast, unsalted digest of a file or message (the opposite design goal), use the hash generator; to score a candidate before you hash it, the password strength checker rates it, and the password generator makes a fresh secret worth hashing.
Two limitations are worth stating plainly. This build runs bcryptjs, a pure-JavaScript implementation slower than the native bcrypt on a server, so read the reported timings as a feel for how cost scales rather than the exact figures you will meet in production — measure your final cost on the machine that will do the real hashing. And bcrypt is showing its age: it is heavy on CPU but light on memory, which leaves it cheaper to attack with GPUs and ASICs than a memory-hard design. For new systems, Argon2id or scrypt hold up better against that hardware; bcrypt stays a sensible, widely-supported choice where they are not on the table.
Privacy note
Everything you type stays on your device. Hashing and verifying run in your browser through bcryptjs, which ships as part of PrivacyKit itself — on your first hash or verify the browser fetches that code file (not your input) from our own origin, and after that nothing you enter is transmitted anywhere. The salt is generated by your browser’s secure random source, no hash is written to storage, and no server ever receives the string or the digest. One caveat: a bcrypt hash is not an encrypted vault. Hand someone the hash and they can run offline guesses against it, so treat the output as sensitive even though it cannot be reversed directly.