A cipher is an algorithm that encrypts and decrypts data. It takes plaintext and a key, and produces ciphertext that looks like random noise. Without the key, the ciphertext is useless. With the key, the original message comes back. Ciphers have been around for thousands of years, from Caesar's shift cipher to the Enigma machine to modern AES. The math has changed. The goal has not.
Modern ciphers come in two flavors. Symmetric ciphers use the same key for encryption and decryption. AES is the standard, used everywhere from disk encryption to HTTPS. It is fast and secure with proper key sizes. Stream ciphers like ChaCha20 encrypt data one bit or byte at a time and work well on devices without hardware acceleration. Asymmetric ciphers use a key pair and solve the key distribution problem, but they are slower and used mostly for key exchange and signatures. The cipher is only as strong as its implementation. Weak keys, reused nonces, and bad padding have broken systems that used strong algorithms. The math is usually not the weak point.
Cipher categories
- Classical — substitution and transposition, historically important
- Symmetric block — AES, encrypts fixed-size blocks
- Symmetric stream — ChaCha20, encrypts continuous data
- Asymmetric — RSA, ECC, used for key exchange and signatures
Do not invent your own cipher. Use established algorithms and libraries that have survived decades of scrutiny.
Comments
No comments yet. Be the first to share a thought.
Leave a comment