How encryption works
Every encryption scheme has two parts: an algorithm, which is public and the same for everyone, and a key, which is the secret. NIST describes encryption as “the process of changing plaintext into ciphertext using a cryptographic algorithm and key.”1 The reverse, decryption, changes the ciphertext back into plaintext with the right key.1
Because the algorithm is public, the security rests on the key. A good scheme gives an attacker who has the ciphertext but not the key nothing better to do than try keys one by one, and with a key of 256 bits there are far too many to try.
Symmetric and asymmetric encryption
| Compared | Symmetric | Asymmetric (public key) |
|---|---|---|
| Keys | One secret key that encrypts and decrypts | A public key and a private key |
| Who holds them | Everyone who needs to read the data | Anyone can have the public key, only the owner has the private one |
| Speed | Fast, used for the data itself | Slower, used to agree on or share keys |
| Example | AES-256 | RSA, X25519, ML-KEM |
A symmetric key is “used to perform both the cryptographic operation and its inverse”, to encrypt and to decrypt.2 Asymmetric, or public-key, cryptography “uses two separate keys to exchange data”: one to encrypt and one to decrypt.3 Most real systems use both. A public-key step lets two sides agree on a fresh symmetric key, and the symmetric key then encrypts the actual data.
Where you meet encryption
- In transit. The padlock in your browser means the page came over TLS, so people on the same network see only ciphertext on the way.
- At rest. Phones and laptops encrypt their storage, so a lost device doesn’t give up its files.
- End to end. Messages are encrypted on the sender’s device and only decrypted on the recipient’s, so the service in the middle carries ciphertext.
Who holds the key matters as much as the algorithm. Data encrypted in transit can still sit readable on a company’s server once it arrives. End-to-end and zero-access encryption keep the key away from the service.
Encryption and quantum computers
A large enough quantum computer could break the public-key methods in wide use today, such as RSA and elliptic curves. Symmetric encryption like AES-256 is not broken the same way. NIST’s draft transition plan proposes deprecating the weaker RSA and elliptic-curve sizes after 2030 and disallowing both after 2035, with ML-KEM as the replacement for key establishment.4 Data recorded today could be decrypted then, which is why the switch to post-quantum encryption is already under way.
Related terms
Sources
- NIST Computer Security Resource Center, Glossary: encryption, definitions from NIST SP 800-82r3 (from RFC 4949) and SP 800-57 Part 1 Rev. 5; see also decryption.
- NIST Computer Security Resource Center, Glossary: symmetric key, definition from FIPS 201-3.
- NIST Computer Security Resource Center, Glossary: asymmetric cryptography, definition from FIPS 204.
- NIST, IR 8547 (initial public draft): Transition to Post-Quantum Cryptography Standards.
Questions about encryption
What is encryption in simple terms?
Locking data with a key. The data becomes unreadable ciphertext, and only someone with the right key can turn it back into the original.
What are the two types of encryption?
Symmetric encryption, which uses one secret key to encrypt and decrypt, and asymmetric or public-key encryption, which uses a public key and a matching private key. Most systems use both together.
Can encryption be broken?
Strong, modern encryption used correctly is not broken by trying keys. Attacks go after weak passwords, stolen keys, flawed software or, in the future, quantum computers against older public-key methods.
What is the difference between encryption and hashing?
Encryption can be reversed with the key. Hashing is one-way: it turns data into a fixed-length fingerprint that can’t be turned back, which is why sites store password hashes instead of passwords.
Is my email encrypted?
Most email is encrypted in transit between servers with TLS, but it is usually stored readable on the provider’s servers. Our blog post on whether your email is encrypted shows how to check.