分类
哈希与加密
本分类下的所有工具与文章,集中在一处。
工具
哈希生成器(SHA-1/256/384/512)
使用浏览器原生的 Web Crypto,计算任意文本的 SHA-1、SHA-256、SHA-384 和 SHA-512 摘要,以 hex 和 Base64 显示。完全在你的浏览器中运行。
Hash Preimage Finder
Watch a bounded, local brute-force search recover a weak hash input in seconds, or run out of keyspace on anything with real entropy. No wordlist, no table, just your browser. A demonstration of why fast, unsalted hashes fail.
HMAC 生成器(SHA-256/384/512)
使用你的密钥,通过浏览器原生的 Web Crypto 对消息计算带密钥的 HMAC,以 hex 和 Base64 显示。与 JWT 验证器用于 HS256 的构造相同。你的密钥不会离开你的浏览器。
文章
哈希、加密与编码:三种不同的事物
三种被不断混淆的操作,由两个问题干净地区分:它可逆吗?它需要密钥吗?
阅读密码学哈希:SHA-256 与 SHA-2 系列
哈希函数保证什么、使其成为密码学的那些性质,以及为何摘要不是加密。
阅读选择一个哈希:MD5、SHA-1、SHA-2、SHA-3 与 BLAKE
哪些哈希函数仍然安全、哪些已被攻破、它们的输出大小,以及如何选择正确的那个。
阅读碰撞、原像抗性与生日界
密码学哈希必须具备的三个安全性质、碰撞为何重要,以及决定真实强度的生日数学。
阅读存储密码:bcrypt、scrypt 与 Argon2
为何像 SHA-256 这样的快速哈希是存储密码的错误工具,以及加盐和工作因子究竟做了什么。
阅读HMAC:用于消息认证的带密钥哈希
为何普通哈希能证明完整性却不能证明真实性、一个秘密密钥如何修补这一点,以及为何 HMAC 的结构至关重要。
阅读为何用 HMAC,而非 hash(密钥 + 消息)
破坏朴素带密钥哈希的长度扩展攻击,以及 HMAC 用来挫败它的嵌套构造。
阅读用 HMAC 认证 API 请求
一个共享秘密和一个哈希如何让服务器信任一个它未曾目睹其发出的请求,以及重放保护如何融入其中。
阅读安全地验证 HMAC:恒定时间与重放
为何用 == 比较签名会泄露一个时间侧信道,以及为何仅有一个有效签名并不能阻止一个被重复的请求。
阅读Why Cryptographic Hashes Are One-Way
A cryptographic hash maps any input to a fixed-size digest and is designed so that recovering the input from the digest is infeasible. That property, preimage resistance, is why you cannot decrypt a hash. The only ways to reverse one are to look it up or to guess-and-check, both of which are search, not inversion.
阅读Brute Force vs Lookup Tables: Two Ways to Reverse a Hash
Since a hash cannot be inverted, reversing one means searching, and there are two families. Precompute a giant table of input-to-hash pairs and look the hash up (what CrackStation does), or generate candidates on the fly and hash each until one matches (brute force). They trade storage for compute in opposite directions.
阅读Why Salting Defeats Precomputed Tables
A salt is a unique random value stored with each password hash and mixed in before hashing. It makes identical passwords hash differently, which destroys the economics of precomputed tables: an attacker would need a separate table for every salt. Salting is the specific defense that neutralizes lookup services and rainbow tables.
阅读Slow KDFs: bcrypt, scrypt, and Argon2
Salting defeats precomputation but not a targeted guess-and-check attack; a fast hash still lets an attacker try billions of candidates per second. Slow key derivation functions fix that by making each guess deliberately expensive and tunable, cutting an attacker's rate by many orders of magnitude. These are what you should store passwords with.
阅读Keyspace, Entropy, and Crack Time
Whether brute force can reverse a hash comes down to keyspace size versus the attacker's hashing rate. Keyspace grows exponentially with length and alphabet, so a few extra characters move a secret from cracked in seconds to infeasible for millennia. This is the arithmetic behind why length and randomness matter most.
阅读Choosing a Password Hash
Storing passwords safely is a solved problem: use a purpose-built, salted, slow password hash, not a raw digest. This is a short decision guide, from the algorithm to pick to the parameters to set and the mistakes to avoid, aligned with OWASP and NIST guidance.
阅读