The science of keeping secrets. From Caesar ciphers to quantum-resistant algorithms, cryptography is the backbone of all digital security — authentication, confidentiality, integrity, and non-repudiation.
Cryptography is the practice of securing communication so that only intended recipients can read it. It provides four core guarantees in security, often called the CIA Triad + Non-Repudiation:
Only authorized parties can read the data. Achieved through encryption.
Data hasn't been tampered with in transit. Achieved through hashing.
Verify the identity of the sender. Achieved through digital signatures and certificates.
The sender cannot deny sending the message. Achieved through digital signatures.
Real-world analogy: Encryption is putting a letter in a locked box. Hashing is putting a tamper-evident seal on the envelope. A digital signature is notarizing the letter — proving who wrote it and that it hasn't been changed.
In practice, both are used together. TLS uses asymmetric crypto to securely exchange a symmetric session key, then uses that fast symmetric key for the actual data transfer. This is called a hybrid cryptosystem.
A hash function takes input of any size and produces a fixed-size output (the "digest"). Key properties:
Cannot reverse the hash back to the original input
Same input always produces the same hash
Tiny input change = completely different hash
Uses: Password storage (with salting), file integrity verification, digital signatures, blockchain, certificate fingerprints.
The Public Key Infrastructure (PKI) is the trust system that makes HTTPS possible. It relies on Certificate Authorities (CAs) — trusted third parties that vouch for the identity of websites.
Digital document binding a public key to an identity (domain name). Signed by a CA.
The top of the trust chain. Pre-installed in browsers/OS. DigiCert, Let's Encrypt, etc.
Root CA signs Intermediate CA, which signs website cert. Browser validates the entire chain.
A digital signature proves who sent a message and that it wasn't altered. It combines hashing with asymmetric encryption:
| Algorithm | Type | Key Size | Speed | Status | Use Case |
|---|---|---|---|---|---|
| AES-256 | Symmetric | 128/192/256 | Fast | Secure | TLS data, disk encryption, VPN |
| ChaCha20 | Symmetric | 256 | Very Fast | Secure | Mobile TLS, WireGuard VPN |
| 3DES | Symmetric | 168 (eff. 112) | Slow | Deprecated | Legacy systems only |
| DES | Symmetric | 56 | Medium | Broken | Never use — crackable in hours |
| RSA-2048 | Asymmetric | 2048+ | Slow | Secure | Key exchange, signatures, email |
| ECC (P-256) | Asymmetric | 256 | Moderate | Secure | TLS handshake, mobile crypto |
| SHA-256 | Hash | N/A | Fast | Secure | Integrity, certs, blockchain |
| MD5 | Hash | N/A | Fast | Broken | Never use for security |
| bcrypt | Hash (KDF) | N/A | Slow (on purpose) | Secure | Password hashing |
Try every possible key until one works. Defeated by long keys (AES-256 = 2256 combinations) and rate limiting.
Pre-computed table of hash → plaintext mappings. Defeated by salting — adding random data before hashing.
Attacker intercepts key exchange and substitutes their own public key. Defeated by PKI certificate verification.
Finding two inputs that produce the same hash. MD5 and SHA-1 are vulnerable. Use SHA-256+ to avoid.
Forcing a connection to use an older, weaker protocol (e.g., TLS 1.0). Defeated by enforcing TLS 1.2+ minimum.
Exploits the birthday paradox to find hash collisions faster than brute force. Mitigated by using longer hash digests.
Experiment with encryption and hashing in real-time. Type a message and watch it transform.
The simplest cipher — shift each letter by N positions. Easily broken by frequency analysis, but helps visualize the concept of key-based transformation.
XOR is the fundamental building block of modern encryption. Each bit is flipped if the key bit is 1. XOR with the same key twice returns the original — this is how symmetric encryption works at the hardware level.
Type anything below and watch the SHA-256 hash update in real-time. Notice how even a tiny change completely alters the output (avalanche effect).
Watch the TLS handshake play out step by step. This happens every time your browser connects to an HTTPS website.
All certification names are referenced for educational purposes only. This project is not affiliated with any certification body.