Cryptography
Cryptography is the science of protecting information by transforming it into an unreadable format that only authorised parties can understand. It uses mathematical algorithms and "keys" to scramble data, ensuring it remains secure while stored (at rest) or sent over a network (in transit).
Types of Cryptographyβ
| Types | How it works | Examples | Use Cases |
|---|---|---|---|
| Symmetric | Uses a single shared key for both encryption and decryption. It is fast and ideal for large data sets. | AES, DES | Disk encryption, VPNs |
| Asymmetric | Uses a pair of keys: a Public key (to encrypt) and a Private key (to decrypt) | RSA, ECC, DSA | TLS, digital signatures, SSH, PGP |
| Hashing | A one-way function that creates a fixed-length "fingerprint" of data. It cannot be reversed to reveal the original message. | SHA-2, SHA-3, MD5(obsolete), SHA-1(obsolete) | Password storage, data integrity, digital signatures |
Real-world useβ
- HTTPS: Secures web browsing.
- End-to-End Encryption: Used by apps like WhatsApp and Signal to ensure only you and the recipient can read messages.
- Digital Signatures: Verifies the authenticity of software updates and legal electronic documents.
- Cryptocurrency: Uses blockchain technology and hashing to secure digital transactions without a central bank.
- Password Storage: Systems store "hashes" of your password rather than the actual text to protect your login even if a database is breached.
Ciphersβ
- Caesar Cipher - A substitution cipher where each letter is shifted by a fixed number.
- Vigenère Cipher - A method of encrypting alphabetic text by using a simple form of polyalphabetic substitution.
- The Enigma machine from World War II - A complex electro-mechanical rotor cipher machine used by Nazi Germany.
- The one-time pad from the Cold War - An encryption technique that cannot be cracked if used correctly, involving a random key that is as long as the message.
Toolsβ
- dCode - Online cryptography tools for ciphers, hashes, and more.
- CyberChef - A web app for encryption, encoding, and data analysis.
- Cryptool - An open-source educational tool for learning cryptography concepts.
- Hashcat - A powerful password recovery tool supporting various hash algorithms.
- GnuPG (GPG) - A complete and free implementation of the OpenPGP standard for encrypting and signing data.
- OpenSSL - Command-line crypto toolkit (
openssl enc,openssl dgst,openssl genpkey) - GPG: File/email encryption and signing (
gpg --encrypt,gpg --sign)
Booksβ
- Introduction to Modern Cryptography: Third Edition - A comprehensive introduction to the principles and techniques of modern cryptography.
Linksβ
- Hash, Cryptography, Encoding Online Tool - An online tool for hashing, cryptography, and encoding/decoding.
- GitHub Awesome Cryptography - A curated list of cryptography resources, libraries, and tools.
- TryHackMe Cryptography Basics - A beginner-friendly introduction to cryptography concepts and techniques.
- TryHackMe Public Key Cryptography - A hands-on room focused on understanding public key cryptography.
- TryHackMe Hashing Basics - Learn about hashing algorithms, their uses, and how to crack hashes.
- Payment Card Industry Digital Security Standard (PCI DSS) - TLDR: You learn that the data should be encrypted both while being stored (at rest) and while being transmitted (in motion).
- Cryptography Glossary - MDN Web Docs - A comprehensive glossary of cryptographic terms and concepts.
- Crypto101 - An introductory book on cryptography, covering fundamental concepts and practical applications.
- Practical Cryptography for Developers
- OWASP Cryptographic Storage Cheat Sheet
- NIST Cryptographic Standards
- Python packages
- Practical Cryptography With Go - A practical guide to implementing cryptographic techniques using the Go programming language.
- The Joy of Cryptography - An online book that explores the beauty and intricacies of cryptography.
- Cipher