Security
What is Encryption?
Definition
Encryption is the reversible transformation of data into ciphertext using a key, so that only someone holding the right key can recover the original.
Also known as: Cipher, Ciphertext
Encryption in more detail
Two families do the work. Symmetric encryption uses one shared key for both directions and is fast, which is why AES protects the bulk of stored files and network traffic. Asymmetric encryption uses a mathematically linked pair — a public key that anyone may hold and a private key that must not leave its owner — so a message can be encrypted to someone you have never met. It is far slower, so real protocols use it briefly to agree a symmetric key and then switch.
Reversibility is the defining property, and it is what separates encryption from hashing: encryption is designed to be undone with the key, hashing is designed never to be undone at all. Encoding, meanwhile, is neither — base64 and URL-encoding are reformatting with no key and no secrecy, and calling them encryption is a common and consequential mistake.
In practice the algorithm is rarely the weak point. Key management is: where keys are stored, who can read them, how they are rotated, what happens when one leaks. Encryption at rest protects a stolen disk but not a running application that can already decrypt; encryption in transit protects the wire but not either endpoint; end-to-end encryption keeps the key on the participants' devices so the service in the middle holds only ciphertext. Authenticated modes such as AES-GCM are the default now because encryption without integrity lets an attacker alter ciphertext undetected.
Encryption example
Symmetric — one key, both directions
plaintext + key --AES-256-GCM--> ciphertext + auth tag
ciphertext + key --------------> plaintext
(wrong key, or a tampered byte, and decryption fails outright)
Asymmetric — a key pair
encrypt with the RECIPIENT'S public key -> only they can read
sign with YOUR private key -> anyone can verify
TLS uses both: asymmetric to agree a key, symmetric for the data.
Not encryption, despite appearances
base64("hello") = "aGVsbG8=" reversible by anyone, no key
SHA-256("hello") = "2cf24dba..." one-way, cannot be reversedEncryption — common questions
- What is the difference between encryption and hashing?
- Encryption is two-way: with the key you get the original back. Hashing is one-way by design and cannot be reversed, which is why passwords are hashed and never encrypted. They solve different problems and are not interchangeable.
- Is base64 encryption?
- No. Base64 is an encoding — a reversible reformatting with no key and no secret. Anyone can decode it instantly. It provides zero confidentiality and should never be used to protect anything.
- What is end-to-end encryption?
- Encryption where only the communicating endpoints hold the keys, so intermediaries — including the service provider — carry ciphertext they cannot read. It is stronger than ordinary transport encryption, where the server decrypts everything it receives.
Keep reading
Every definition in the set is indexed A-Z in the developer glossary, and the cheat sheets cover the syntax once you know what you are looking for.
Browse the A-Z glossary