bcrypt 哈希比对

Check a candidate password against a bcrypt hash without trimming spaces. Inputs above 72 UTF-8 bytes are rejected to prevent silent truncation.

输入: 文本结果: 文本

文本输入

运行后查看结果

案例

验证 Apache 生成的 Bcrypt 口令

输入

correct horse battery staple

Expected answer

Match

哈希
$2y$04$61rxEDaR3PSKMDB/eWLl/urGkJ9Tv9DqmuoL2gfueVB.Ccqbw/JHq
识别大小写变化且不回显密码

输入

Correct horse battery staple

Expected answer

No match

哈希
$2y$04$61rxEDaR3PSKMDB/eWLl/urGkJ9Tv9DqmuoL2gfueVB.Ccqbw/JHq
识别复制密码时多出的末尾空格

输入

correct horse battery staple 

Expected answer

No match

哈希
$2y$04$61rxEDaR3PSKMDB/eWLl/urGkJ9Tv9DqmuoL2gfueVB.Ccqbw/JHq
接受恰好 72 个 ASCII 字节

输入

0123456789012345678901234567890123456789012345678901234567890123456789AB

Expected answer

Match

哈希
$2y$04$SVHoaZ/YvW3oYrcmsXsZ9epfQq88AwEZG/Vw7.aYp6gRxrSoWFAnq
拒绝第 73 个字节,避免仅匹配前缀

输入

0123456789012345678901234567890123456789012345678901234567890123456789ABC

Expected rejection

Message contains
Bcrypt accepts at most 72 UTF-8 bytes here; longer passwords are rejected to avoid silent truncation.
哈希
$2y$04$SVHoaZ/YvW3oYrcmsXsZ9epfQq88AwEZG/Vw7.aYp6gRxrSoWFAnq
24 个汉字正好占 72 个 UTF-8 字节

输入

茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶茶

Expected answer

Match

哈希
$2y$04$obm1IVNBttgCKd9qusGWvOsXYXpnHe.aoyrZEEKXiJLsPhGTikrEu
拒绝不完整的 Bcrypt 哈希

输入

public-example

Expected rejection

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

Reproduce this published regression case and compare the exact result. Bcrypt compare: dolphin.

输入

dolphin

Expected answer

Match

哈希
$2a$10$qyon0LQCmMxpFFjwWH6Qh.dDdhqntQh./IN0RXCc3XIMILuOYZKgK
invalid salt version

Reproduce this published regression case and compare the exact result. Bcrypt compare: invalid salt version.

输入

password

Expected rejection

Message contains
Invalid bcrypt hash:
哈希
$ab$04$K.H1WlFDQ/iIo/PiprT/puwluJ5rzuSE5q8D/Fk3NuLgU2aXiGR9m

相关工具

哈希

操作参考

查看原始技术文档 (English)