Bcrypt parse

Inspect a bcrypt hash’s version, cost factor, actual rounds, salt and digest. Parsing does not check a password or run bcrypt.

Input: TextResult: Text

Text input

Run to see the result

Examples

Separate cost 4 from its 16 rounds

Input

$2y$04$61rxEDaR3PSKMDB/eWLl/urGkJ9Tv9DqmuoL2gfueVB.Ccqbw/JHq

Expected answer

Algorithm
bcrypt
Version
2y
Cost factor
4
Rounds
16
Salt
61rxEDaR3PSKMDB/eWLl/u
Digest
rGkJ9Tv9DqmuoL2gfueVB.Ccqbw/JHq
Read the legacy 2a format from a published fixture

Input

$2a$10$qyon0LQCmMxpFFjwWH6Qh.dDdhqntQh./IN0RXCc3XIMILuOYZKgK

Expected answer

Algorithm
bcrypt
Version
2a
Cost factor
10
Rounds
1024
Salt
qyon0LQCmMxpFFjwWH6Qh.
Digest
dDdhqntQh./IN0RXCc3XIMILuOYZKgK
Read the compatible 2b prefix and a different cost

Input

$2b$05$pfhCAFCJh9MyGjtfB9I59ubDfo1fY5anA6uHlroj1GHTOLFd5Msii

Expected answer

Algorithm
bcrypt
Version
2b
Cost factor
5
Rounds
32
Salt
pfhCAFCJh9MyGjtfB9I59u
Digest
bDfo1fY5anA6uHlroj1GHTOLFd5Msii
Inspect cost 31 without running 2 billion rounds

A synthetic metadata record; changing the cost field does not create a valid password hash.

Input

$2y$31$pfhCAFCJh9MyGjtfB9I59ubDfo1fY5anA6uHlroj1GHTOLFd5Msii

Expected answer

Algorithm
bcrypt
Version
2y
Cost factor
31
Rounds
2147483648
Salt
pfhCAFCJh9MyGjtfB9I59u
Digest
bDfo1fY5anA6uHlroj1GHTOLFd5Msii
Reject a record with the last digest character missing

Input

$2y$04$61rxEDaR3PSKMDB/eWLl/urGkJ9Tv9DqmuoL2gfueVB.Ccqbw/JH

Expected rejection

Message contains
Invalid bcrypt hash: use a complete 60-character $2a$, $2b$ or $2y$ hash with cost 04–31.
Reject a cost factor outside the bcrypt format

Input

$2y$03$61rxEDaR3PSKMDB/eWLl/urGkJ9Tv9DqmuoL2gfueVB.Ccqbw/JHq

Expected rejection

Message contains
Invalid bcrypt hash: use a complete 60-character $2a$, $2b$ or $2y$ hash with cost 04–31.
Reject a character outside the bcrypt alphabet

Input

$2y$04$61rxEDaR3PSKMDB/eWLl/urGkJ9Tv9DqmuoL2gfueVB.Ccqbw/JH@

Expected rejection

Message contains
Invalid bcrypt hash: use a complete 60-character $2a$, $2b$ or $2y$ hash with cost 04–31.

Format reference: Bcrypt parse background and specification

Related tools

Browse hashing tools