Security & Cryptography • 5 min read

Cryptography 101: Cryptographic Hashes, Password Entropy & Digital Signatures

Learn the fundamentals of modern cryptography: how SHA-256 and MD5 checksums work, how to calculate password entropy, and how to verify API signatures with HMAC.

Published: 2026-10-22 • Last Updated: 2026-11-11 • By Mohammed Zawwar Hussain

Interactive Online Tools Referenced in this Guide

Understanding One-Way Cryptographic Hashes (SHA-256 vs MD5)

A cryptographic hash function takes arbitrary binary data and produces a fixed-size digest (e.g. 256 bits for SHA-256). These functions are strictly one-way: given the output hash, it is mathematically infeasible to determine the original input. You can verify software downloads and compute integrity checksums using our SHA-256 Hash Calculator.

Password Entropy: Measuring True Security

Password complexity rules (e.g. must have uppercase and symbol) often result in predictable patterns like P@ssw0rd1!. A better measure for a randomly generated password is its entropy in bits: E = L × log2(R), where L is the length and R the number of possible characters. A 16-character password drawn from 94 printable characters has about 105 bits; even at a trillion guesses per second, searching that space would take far longer than the age of the universe. Entropy only applies to truly random passwords: P@ssw0rd1! looks complex but is among the first guesses attackers try. Test your credentials with our client-side Password Strength Checker or generate cryptographically secure random credentials with our Password Generator.

Hashing, encryption and HMAC are different jobs

  • Hashing turns data into a fixed-length fingerprint and cannot be reversed. Use it to check that a download is intact: compare its SHA-256 from Hash Calculator with the value the vendor publishes.
  • Encryption scrambles data so that only someone with the key can turn it back. Use it to protect content, for example with Protect PDF, which encrypts a whole PDF with AES-256.
  • HMAC is a hash mixed with a secret key. It proves a message came from someone who knows the key and was not changed. Webhook signatures from payment providers work this way; HMAC Generator computes them.
A quick test vector shows how sensitive this is: the HMAC-SHA256 of The quick brown fox jumps over the lazy dog with the key key is f7bc83f4…2d1a3cd8; change one letter of either and every character of the result changes.

How much entropy is enough?

Entropy measures how many guesses an attacker needs. For random passwords it is length × log2(number of possible characters):
PasswordEntropyVerdict
8 random lower-case letters37.6 bitsToo weak for anything important
8 random characters, all 94 printable52.4 bitsWeak against offline cracking
4 random dictionary words (7,776-word list)51.7 bitsMemorable but borderline
6 random dictionary words77.5 bitsStrong and memorable
12 random characters, all 94 printable78.7 bitsStrong
16 random letters and digits95.3 bitsVery strong; good for a password manager
These numbers hold only for truly random choices. A password you invent, such as a name plus a year, has far less entropy than its length suggests, which is why Password Generator uses the browser's cryptographic random source.

Why websites must not store SHA-256 of passwords

SHA-256 is designed to be fast; modern graphics cards compute billions of hashes per second, so a leaked table of SHA-256 password hashes falls quickly. Sites should use a slow, salted password hash (bcrypt, scrypt or Argon2), which makes every guess expensive and stops one cracked hash from revealing everyone who chose the same password. If you build a login system, use your framework's password-hashing function rather than writing your own.

A practical routine

  1. Use a password manager and let it generate a different password for every site.
  2. Remember only a few strong passphrases: the manager, your email and your phone account.
  3. Turn on two-factor authentication everywhere it is offered, preferably an authenticator app or passkey rather than SMS.
  4. Change a password straight away if the service reports a breach, and anywhere you reused it.
For more detail on managing passwords day to day, see how to create and manage strong passwords.

Two-factor options, weakest to strongest

  1. SMS codes: far better than nothing, but vulnerable to SIM-swap fraud and message interception.
  2. Authenticator apps (time-based codes): the code is generated on your phone and never travels over the phone network.
  3. Passkeys and hardware security keys: they cannot be phished, because they only work on the genuine website.
Whatever you choose, store the recovery codes somewhere safe and offline, such as a printed copy or your password manager.

Sharing a protected file safely

When you send a sensitive PDF, encrypt it with Protect PDF (AES-256) and send the password through a different channel: the file by email, the password by phone or a messaging app. Anyone who intercepts only one of the two gets nothing useful. Use a long random password from Password Generator rather than a date of birth or a company name, because encrypted files can be attacked offline without any limit on guesses. The guide to password-protecting a PDF explains the options.

Frequently Asked Questions

Can a SHA-256 hash be decrypted back to the original text? ↓
No. Cryptographic hash functions are irreversible mathematical operations. The original text can only be identified by hashing potential inputs and checking for matching hashes (rainbow tables or brute force).
Is MD5 still safe? ↓
For spotting accidental file corruption, yes. For anything security-related, no: MD5 and SHA-1 collisions can be produced deliberately. Use SHA-256.
Does the strength checker send my password anywhere? ↓
No. Password Strength Checker runs in your browser while you type and does not store or send the password.
Are passphrases better than complex passwords? ↓
Six random words give about 77 bits, as much as 12 random characters, and are much easier to type and remember.
Should the PDF password be sent in the same email? ↓
No. Send it separately, for example by phone or text message, so that one intercepted message is not enough to open the file.