Online Privacy

Encryption Explained

Understand what encryption protects, how keys and algorithms work together, where you already rely on it, and what it cannot do for you.

Key takeaways

  • Encryption turns readable data into ciphertext that is useless without the correct key.
  • The strength of modern encryption rests on keeping keys secret, while the algorithms themselves are public and widely studied.
  • Data can be protected in transit, at rest or end to end, and each protects against different people.
  • Weak passwords, stolen keys and compromised devices defeat encryption far more often than broken math.
  • Encryption provides secrecy, and modern designs also detect tampering and confirm identity when combined with other tools.

Encryption scrambles information so that only someone holding the right key can read it. The readable original is called plaintext, the scrambled result is called ciphertext, and the key is a piece of secret data that controls the transformation in both directions.

You use it constantly: when a browser shows a secure connection, when your phone locks its storage, when your Wi-Fi asks for a password and when a card payment goes through. Knowing which of those protections applies, and where it stops, tells you what is actually safe.

The basic idea

Picture a locked box. Anyone can carry it, shake it or photograph it, but only a key holder can open it. Encryption works similarly on bits. An algorithm (also called a cipher) is the published procedure. The key is a long random number that makes your use of the procedure different from everyone else's.

Old pencil-and-paper ciphers shifted or swapped letters. A famous example moves each letter a fixed number of places in the alphabet. It falls quickly because there are only a few possible shifts and the patterns of language show through. A good modern cipher produces output that looks like random noise, and changing one bit of the input or key changes the output unpredictably.

The round trip from plaintext to ciphertext and back
1 Plaintext A readable message, file or stream of data. 2 Encrypt with a key A published algorithm mixes the data using a secret value. 3 Ciphertext Scrambled bytes that can be stored or sent openly. 4 Decrypt with a key The matching key reverses the process. 5 Plaintext again The original returns, and tampering can be detected. Plaintext A readable message, file or stream of data. 1 Encrypt with a key A published algorithm mixes the data using a secret value. 2 Ciphertext Scrambled bytes that can be stored or sent openly. 3 Decrypt with a key The matching key reverses the process. 4 Plaintext again The original returns, and tampering can be detected. 5

Why the algorithm can be public

A principle often credited to Auguste Kerckhoffs holds that a cipher system should remain secure even if everything about it except the key is known. This is why respected algorithms are published and attacked by researchers for years. A secret homemade method has had no such testing and usually fails once someone looks closely.

The most widely used cipher for bulk data is AES (Advanced Encryption Standard), published by NIST as FIPS 197. It works on 128-bit blocks with keys of 128, 192 or 256 bits. Another common choice is ChaCha20-Poly1305, described in RFC 8439, which performs well on devices without dedicated AES hardware.

Keys and why length matters

A key of n bits has 2 to the power n possible values. Each added bit doubles the work of trying them all. At 128 bits, the number of possibilities is so large that exhaustive search isn't considered feasible with conventional computers.

That math only helps if the key is random. Most people don't memorize 128 random bits; they type passwords. Software turns a password into a key using a deliberately slow process called a key derivation function, which makes each guess expensive. It can't rescue a password like a pet's name followed by a year, because an attacker tries likely guesses first. Use long, unique passphrases or a password generator, and see how password managers work.

The two families of encryption

Symmetric encryption uses the same key to lock and unlock. It is fast and handles large amounts of data. Its difficulty is getting the key to the other party safely.

Public-key (asymmetric) encryption uses a mathematically linked pair. You can publish the public key; the private key stays with you. It solves key sharing and enables signatures, but it is slower and works on small inputs.

Real systems combine them. A connection typically uses public-key techniques to authenticate and agree on a temporary secret, then symmetric encryption for the actual traffic. The comparison of symmetric and public-key encryption walks through this hybrid pattern.

In transit, at rest and end to end

Where encryption starts and stops determines who can read the data.

Type What it covers Who can still read the data
In transit Data moving between two points, such as browser and server Both endpoints, including the service
At rest Data stored on disk or in a database Whoever holds the key, often the device owner or provider
End to end Data from sender's device to recipient's device The communicating devices, not the relay service

In transit protection on the web comes from TLS, the basis of HTTPS. See HTTPS and TLS explained.

At rest protection on laptops and phones means a thief who removes the storage sees ciphertext. Full-disk encryption protects a powered-off or locked device far better than one that is unlocked and running.

End-to-end encryption keeps the relaying company from reading content, covered in end-to-end encryption in messaging.

Three places encryption can apply
In transit Protects data crossing a network Stops onlookers on Wi-Fi and along the path The receiving server sees plaintext At rest Protects stored files and drives Helps if hardware is lost or stolen An unlocked system can still read it End to end Keys live on users' devices The relay service handles only ciphertext A compromised endpoint still exposes content In transit Protects data crossing a network Stops onlookers on Wi-Fi and along the path The receiving server sees plaintext At rest Protects stored files and drives Helps if hardware is lost or stolen An unlocked system can still read it End to end Keys live on users' devices The relay service handles only ciphertext A compromised endpoint still exposes content

Integrity and identity

Secrecy alone isn't enough. An attacker who can't read a message might still alter it. Modern authenticated encryption modes, such as AES-GCM and ChaCha20-Poly1305, attach a tag that fails to verify if even one bit has changed.

You also need to know who holds the other key. Encrypting perfectly to an impostor protects nothing. Certificates, digital signatures and safety-number comparisons exist to tie keys to identities.

Encryption is not hashing or encoding

Two neighbors get confused with encryption. Hashing produces a fixed-length fingerprint that isn't meant to be reversed, and encoding such as Base64 merely rewrites data in another format that anyone can decode. The article on hashing, encryption and encoding shows how to tell them apart.

What encryption can't do

  • It doesn't hide that communication happened. Addresses, timing and size often remain visible.
  • It doesn't protect data on a device infected with malware, which can read content before encryption or after decryption.
  • It doesn't stop you from sending information to a scam site that happens to use HTTPS. The padlock means the connection is encrypted, not that the owner is honest.
  • It doesn't help if the recipient shares the message.
  • It can't recover your data if you lose the only key.

The last point surprises people. Strong encryption has no hidden bypass by design, so keep recovery keys somewhere safe and separate from the device.

Turning it on in everyday life

  1. Set a screen lock with a strong passcode on your phone, which on modern devices activates storage encryption.
  2. Turn on disk encryption on your computer. Windows offers device encryption or BitLocker depending on edition, macOS has FileVault, and Linux commonly uses LUKS. Save the recovery key.
  3. Use WPA2 or WPA3 on your Wi-Fi with a long passphrase.
  4. Look for HTTPS, and heed certificate warnings.
  5. Choose messaging tools that offer end-to-end encryption by default if that matters to you.
  6. Encrypt backups, especially those on portable drives or cloud services.

For a hands-on feel, you can experiment with a text encryptor using harmless sample text. Encrypt a sentence, change one character of the password and try to decrypt it.

What a strength claim should tell you

Product pages love phrases like "military-grade." They tell you little. A useful description names the algorithm (for example AES-256-GCM), says where keys are generated and stored, explains how passwords become keys and says whether anyone besides you can recover the data. Independent audits and published designs are better signals than adjectives.

Be wary of claims of unbreakable or secret proprietary encryption. Serious products use standard, reviewed building blocks, and their weak spots are usually in key handling, updates and account recovery.

Following one web request

Seeing the pieces work together makes the idea concrete. Say you open https://example.com/ on cafe Wi-Fi.

Your browser looks up the name, connects to the server and starts a TLS handshake. The server presents a certificate showing that its public key belongs to that name, and proves it holds the matching private key. The two sides agree on fresh symmetric keys. From then on, the page you request, any form you submit and the cookies that keep you signed in are encrypted and checked for tampering.

Someone else on the same Wi-Fi can see that your device exchanged data with a particular server address, roughly how much and when. They may learn the site's name from the DNS lookup or the handshake unless extra protections are in use. They can't read the page or the form. The site itself reads everything you send it, and what it does afterward is a matter of policy and its own security, where this connection's encryption plays no part.

Common questions

Can encryption be cracked?

Well-designed modern ciphers with random keys have no known practical break. Successful attacks usually target passwords, software bugs, stolen keys or people. Future quantum computers threaten certain public-key methods, which is why post-quantum cryptography is being deployed.

Does encryption slow things down?

On current hardware the cost is usually small, since many processors accelerate common ciphers. Very old or tiny devices may notice it.

In most countries ordinary use is lawful, and it underpins banking and commerce. Some places restrict certain tools or can compel disclosure in specific circumstances. Check local rules, particularly when traveling.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Online Privacy →

Latest news on this topic