What Is Encryption? How It Works and the Two Types
Encryption is running on almost everything you touch, and the only decision that ever matters is who holds the key. Here is how it works, what the two types are for, and where it quietly stops protecting you.

Encryption has the rare distinction of being both the most used security control on earth and the one people are most confident they will never understand. The mathematics genuinely is hard. The idea is not, and the idea is the part that changes decisions. Almost every practical question about encryption, including the ones about WhatsApp, iCloud, laptops and data breaches, turns out to be the same question wearing different clothes: who has the key?
What Is Encryption?
Encryption takes readable data, called plaintext, and transforms it into unreadable data, called ciphertext, using an algorithm and a key. Decryption reverses it. The plaintext might be a message, a file, a database or an entire disk; the process does not care what the data means.
The single most surprising thing about modern encryption is that the algorithm is public. AES, the standard almost everything uses, is published by NIST in full detail, and its security does not depend on anyone keeping it secret. What is secret is the key. A cipher whose safety rests on nobody knowing how it works has been considered a broken design since the nineteenth century, because the method always leaks eventually and the key can be changed while the method cannot.
The usual analogy is a lock, and it is worth stating its limit up front. A lock protects a box from someone who does not have the key. It does nothing about someone who does have the key, someone you handed the box to, or someone who waits until you have opened it. Every real-world encryption failure is one of those three situations rather than a broken algorithm.
How Does Encryption Work?
Start with the simplest possible cipher. Shift each letter three places along the alphabet and HELLO becomes KHOOR. The algorithm is "shift along the alphabet" and the key is "3". Anyone who knows both gets the message back. Anyone who knows only the algorithm has 25 possibilities to try, which takes a few seconds.
Everything that follows in the history of cryptography is an answer to that last sentence. Real encryption uses algorithms whose output has no visible relationship to the input, and keys drawn from a space so large that trying them all is not a strategy. AES, specified in NIST's FIPS 197, transforms data in 128-bit blocks with keys of 128, 192 or 256 bits.
Those numbers are worth pausing on, because they are the reason brute force is not the threat people imagine. A 128-bit key has roughly 340 undecillion possible values, a 39-digit number. A machine testing a trillion keys every second would still be working on it long after the sun has gone out. AES-256 squares that difficulty. Nobody attacks strong encryption by guessing the key; they attack the software around it, or the person holding it.

Symmetric vs Asymmetric Encryption
There are two families, and the difference is how many keys are involved.
| Symmetric | Asymmetric | |
|---|---|---|
| Keys | One shared key encrypts and decrypts | A public key encrypts, a private key decrypts |
| Speed | Fast, cheap, fine for large amounts of data | Slow, expensive, unsuited to bulk data |
| The hard part | Getting the shared key to the other party safely | Nothing to share secretly, but the maths costs more |
| Common algorithms | AES, ChaCha20 | RSA, elliptic curve cryptography |
| Used for | Files, disks, databases, the bulk of any connection | Proving identity, signatures, agreeing a shared key |
Symmetric encryption is the older and more obvious idea: one key, both directions, like a physical key that locks and unlocks the same door. It works beautifully until you need to send that key to someone you have never met, over a network that other people can read. That problem, key distribution, blocked secure communication between strangers for most of human history.
Asymmetric encryption solved it in the 1970s with a genuinely strange trick: two mathematically related keys, where anything scrambled by the public one can only be unscrambled by the private one. You can publish the public key on a billboard. Anyone can use it to encrypt something for you, and nobody can reverse it without the private key you never sent anywhere.
In practice the answer to "which type should I use" is that you already use both, together, thousands of times a day, and the next section is what that looks like.
How Does HTTPS Encryption Work?
When you open an address that starts with https, your browser and the server run a TLS handshake before any real content moves. Asymmetric encryption does the introductions. Symmetric encryption does the work.
The certificate in row two is what makes this more than a private conversation with a stranger. It is signed by an authority your browser already trusts, and it says that this public key belongs to this domain name. That is the part a look-alike domain cannot fake, and it is why your browser complains loudly when a certificate does not match the address.
It is also the part people over-read. Certificates are free and automated now, which was the right decision for the web and which means a phishing page on a look-alike domain gets one in about thirty seconds.
Encryption in Transit and at Rest
Data has two states worth protecting and they need different controls.
In transit means moving across a network: your browser to a website, your phone to a messaging server, one data center to another. TLS covers most of this and it is now close to universal.
At rest means sitting on a disk: your laptop, your phone, a backup drive, a database server. Full disk encryption is what makes a stolen laptop an inconvenience rather than an incident, and it is why a lost device is not automatically a breach under most notification regimes.
What at-rest encryption does not do is stop someone who has a valid login. The database decrypts for the application, and the application answers whoever authenticated to it. An attacker holding a stolen password or session token is served plaintext by design. This is the single most misunderstood limit in the subject, and it is why encryption sits beside rather than instead of access controls, and why a firewall and multi-factor authentication are not made redundant by it.
What Is End-to-End Encryption?
End-to-end encryption means the data is encrypted on your device and decrypted only on the recipient's device, so the service carrying it never holds a key that would let it read the contents. Everything else in the encrypted category, which is nearly all of it, means the provider encrypts your data and keeps a copy of the key.
CISA's Mobile Communications Best Practice Guidance leads with the instruction to use only end-to-end encrypted communications, naming Signal or a comparable application, after nation-state actors were found inside telecommunications infrastructure. The same guidance tells iPhone users to disable the setting that lets a message fall back to plain SMS, and Android users to use RCS only where end-to-end encryption is switched on. SMS is not encrypted end to end and never was.
The distinction also decides what your backups are. Apple's own iCloud data security overview is unusually clear about it: under standard settings 15 categories including passwords and health data are end-to-end encrypted, while iCloud Backup, Photos and Notes are encrypted with keys Apple holds. Turning on Advanced Data Protection raises that to 25 categories and moves the backup inside the end-to-end boundary, at the cost of Apple being unable to help you recover anything if you lose access.
Is Encryption Good or Bad?
The question shows up in the search results because encryption is the rare security tool that both sides use. Ransomware crews encrypt your files with the same algorithms your bank uses and sell you the key, which is why ransomware and the rest of the modern threat set are not solved by more encryption. Criminals also use encrypted messengers, and law enforcement agencies in several countries have argued for a mechanism that would let them read encrypted traffic with lawful authority.
Our position, and it is not a neutral one: encryption is infrastructure, and the exceptional access proposals do not survive contact with how it works. A key that decrypts for one authorized party is a key that exists, and a key that exists can be stolen, compelled or abused. The same encryption that protects a criminal's messages protects a journalist's sources, a domestic abuse survivor's location and every card transaction in the country. There is no version that only weakens for the people you dislike.
Can Encryption Be Broken?
Not in the way films suggest. Properly implemented AES has never been broken by cryptanalysis, and brute force against a 256-bit key is not a computing problem but a physics one. What fails is everything around the algorithm: keys stored in the same place as the data, a random number generator that is not random, an outdated protocol version still enabled, a key hard-coded in an application, or a person who hands over the passphrase.
The exception on the horizon is quantum computing. A sufficiently large quantum computer would break the asymmetric algorithms that protect key exchange and signatures, RSA and elliptic curve among them, while symmetric algorithms like AES would only be weakened. NIST published the replacements on August 13, 2024: FIPS 203, 204 and 205, covering general encryption and digital signatures, and it urges administrators to start the transition as soon as possible because full integration takes years. The same announcement notes that some experts expect a machine capable of breaking current encryption within a decade.
For an individual, the correct action today is none. The migration happens inside browsers, operating systems and cloud providers, and it is already under way. For an organization that stores data which must stay confidential for ten years or more, the planning starts now, because encrypted traffic captured today can be stored and decrypted later.
How to Use Encryption to Protect Your Data
Key takeaways
- Encryption turns readable data into unreadable data using a public algorithm and a secret key. Only the key is secret.
- Symmetric encryption uses one shared key and is fast. Asymmetric uses a public and a private key and solves the problem of agreeing a key with a stranger.
- HTTPS uses both: asymmetric to prove identity and agree a session key, symmetric for everything after.
- The padlock means encrypted, not honest. Phishing sites have certificates too.
- Encryption at rest protects a stolen disk. It does not protect against an attacker who has a valid login, which is how most breaches happen.
- End-to-end encryption means the provider cannot read your data. Most services described as encrypted are not end to end.
- Strong algorithms are not the weak point. Key handling, old protocol versions and people are.
Common questions
What is encryption in simple words?
Scrambling information so that it looks like nonsense to anyone who does not have the key, and turns back into the original for anyone who does. The scrambling method is public knowledge; the key is the only secret, which is why protecting keys is the whole job.
What are the two types of encryption?
Symmetric and asymmetric. Symmetric uses a single shared key for both encrypting and decrypting, and it is fast enough for large files and disks. Asymmetric uses a public key that anyone can encrypt with and a private key that only you hold, which is what makes secure communication with a stranger possible.
Is encryption good or bad?
Good, and unavoidable, because the same mathematics protects banking, medical records and government systems. Criminals use it too, including ransomware crews who encrypt files and sell the key. There is no design that weakens encryption only for people acting badly, which is why proposals for lawful access keep failing on the engineering rather than the politics.
How does encryption work in messaging apps?
Signal, WhatsApp and iMessage between Apple devices encrypt each message on the sending device with a key that only the recipient's device can undo, so the company carrying it stores something it cannot read. Standard SMS has no such protection, which is why CISA recommends a dedicated encrypted app.
What is the difference between encryption and hashing?
Encryption is reversible with the right key; hashing is not reversible at all. Hashing turns data into a fixed-length fingerprint used to check that something has not changed, or to store passwords in a form nobody can read back. If a service can email you your existing password, it was not hashed.
Is my phone encrypted?
If it has a passcode, almost certainly yes. Modern iPhones and Android devices encrypt storage by default once a passcode is set, and the passcode is part of what unlocks the key. A phone with no passcode is a phone with no encryption, whatever the settings screen claims.
Does a VPN encrypt my data?
A VPN encrypts traffic between your device and the VPN provider's server, which is useful on untrusted networks and hides your browsing from the local network and your internet provider. Beyond that server the traffic continues as normal, and almost all of it is already protected by HTTPS, so a VPN adds less than the marketing suggests.
Can encrypted data be hacked?
The encryption itself is rarely the target. Attackers take the key, use a stolen login that makes the system decrypt for them, or take the data before it is encrypted or after it is decrypted. That is why a breach at an organization with encryption everywhere still produces readable records.
Will quantum computers break encryption?
They would break the asymmetric algorithms used for key exchange and signatures, and weaken but not break symmetric ones like AES. NIST finalized replacement standards in August 2024 and is urging administrators to begin migrating now. Nothing an individual needs to act on; the change arrives through software updates.
What data should I encrypt?
The disk on every device you own, any backup of those devices, and any file you would not want read by whoever finds the drive. Beyond that, the useful questions are about services rather than files: which of the things you store with a provider are end to end encrypted, and which are readable by that provider.

Daniel Reyes
Daniel Reyes is a CISSP who spent twelve years in security operations, most recently leading a detection and response team for a mid-sized healthcare group in Texas. He reviews every resource and breach report on Cyber Security Firms for technical accuracy before it publishes.
Most of the people he has trained arrived having been told too much: a dozen acronyms, six vendors, and no clear idea which risk was theirs. His approach is to explain what an attack actually does before naming the tool that stops it, on the basis that most breaches start with something a reader could have recognised.