A Beginner's Guide to Cryptography
Cryptography is the craft of keeping information readable to the people it is meant for and unreadable to everyone else. The word comes from the Greek for "hidden writing", and the idea is old: long before computers, people scrambled messages with substitution alphabets, transposition grids and shared codebooks, and their opponents spent just as long trying to unscramble them. What changed over the centuries is not the ambition but the mathematics behind it.
Symmetric encryption
The oldest approach uses one secret. You and the person you are writing to agree on a key in advance; the same key locks the message and unlocks it. This is fast and elegant, and it is still what protects most data once a connection has been established. Its weak point is obvious: how do you get the key to someone without an eavesdropper taking it? Every additional person who needs to read your messages needs the key too, which makes sharing harder as a group grows.
Asymmetric encryption
Read more
Public-key cryptography solves the delivery problem by giving each person a pair of related keys. One is public and can be handed out freely; the other stays private. Anything encrypted with the public key can only be opened with the private one, and a signature made with the private key can be verified by anyone holding the public one. The security rests on mathematical problems that are easy to perform in one direction and punishingly hard to reverse.
Hashing and authenticity
Not everything in cryptography is about hiding. A hash function takes any input and produces a fixed-length fingerprint. The same input always gives the same fingerprint, a tiny change gives a completely different one, and you cannot work backwards from the fingerprint to the input. Hashes are how systems check that a file arrived intact and how passwords are stored without keeping the passwords themselves.
Three things worth telling apart
Encoding changes the form of data so it can travel safely — it hides nothing. Hashing is one-way and used for verification. Encryption is reversible, but only with the right key. Mixing these up is one of the most common beginner mistakes.
Practical habits
Do not invent your own cipher or write your own implementation of a standard one; use well-reviewed libraries and let them handle the details. Never reuse a key or a password across services, and prefer long passphrases you can remember over short strings of symbols. Assume that anything sent over a network can be recorded, and treat the small padlock in a browser as a sign of an encrypted connection, not as proof that the site is honest. Finally, remember that cryptography protects data, not people: a stolen key defeats the strongest cipher ever designed.