What is data encryption?

When you log into a bank account, send a private message, or store files in the cloud, encryption is already in use. It keeps the data unreadable to anyone who isn’t meant to see it. In many data breaches, companies report that no sensitive information was exposed. That’s often because the stolen data was encrypted.
Encryption works by converting readable content (text, files, or any other data) into ciphertext using a defined algorithm and a secret key. The result is a binary ciphertext that can’t be understood without the correct key. If it needs to be represented in text form, it’s typically encoded (for example, in Base64 or hexadecimal) for compatibility. Decryption restores the original data, but only if the proper key is used.
How does data encryption work?
Once encrypted, data is no longer readable by anyone without access. Whether someone intercepts your emails or steals a device full of encrypted files, what they get is a jumble of binary or encoded data that makes no sense on its own.
Encryption ensures the data remains unreadable without the proper key. But to also ensure that the data hasn’t been altered (and that it’s from a trusted source), encryption is often paired with tools like message authentication codes (MACs) or digital signatures. Some encryption algorithms, including AES-GCM and ChaCha20-Poly1305, provide authenticated encryption with associated data (AEAD), meaning they handle both encryption and integrity checks in one step.
When implemented properly, encryption helps protect personal data from identity theft and limits exposure to internal or external breaches. In addition, it’s also what secures online payments, keeps companies compliant with regulations, and protects the privacy of digital communications.
(If you’re curious about how this evolved over centuries, here’s a look at the origins of modern encryption.)
Key components: Plaintext, ciphertext, and encryption keys
Three core elements work together in any encryption process:
- Plaintext is the original data; what you start with before encryption. That might be a short note, a customer spreadsheet, or a saved image. It’s in a format you can read or use without needing any key or software.
- Encryption keys are secret values used by algorithms to transform plaintext into ciphertext. If someone else gets hold of your key, they can unlock whatever was protected. The strength of any encryption system relies on keeping those keys secure.
- Ciphertext is what you end up with after the encryption runs. It’s unreadable unless decrypted. If you encrypt ‘Meet at 3pm,’ the raw ciphertext will be binary data. For display or transmission, it might be encoded as something like e483b0a742... in hexadecimal. That result depends on both the algorithm in use and the key that was applied.
Encryption vs. hashing vs. encoding
Encoding, hashing, and encryption all transform data, but with different goals:
- Encoding changes data into another format for compatibility during storage or transmission. For example, Base64 turns binary data into ASCII text so it can travel over systems that only support text. It’s fully reversible, requires no key, and doesn’t hide information.
- Hashing generates a fixed-length output (a “hash”) from input data using a one-way function. The same input always produces the same hash, but even the tiniest change in the input creates a completely different result. This property makes hashes ideal for verifying integrity: if the sender sends a file and its hash, the recipient can run the file through the same hash function. If the hashes match, the file is unchanged; if not, the recipient will know it was corrupted or tampered with. Hashing is also widely used in password storage and digital signatures. Hashes can’t be reversed and don’t use keys.
- Encryption makes data unreadable without the proper key. It’s reversible only with that key and is used to protect confidentiality. By itself, encryption doesn’t guarantee integrity or authenticity, though many modern encryption schemes (e.g., AES-GCM) include those protections.
Types of data encryption
There isn’t one universal way to encrypt data. Systems typically rely on symmetric, asymmetric, or a mix of both, depending on how they’re built and what they’re protecting.
Symmetric encryption (single-key encryption)
Symmetric encryption runs on a single secret key. The same key locks and unlocks the data, which means both sides must already have it before a secure exchange of data can happen.
Symmetric algorithms are very fast and also require fewer operations and less memory compared to asymmetric encryption, which is why they’re trusted to handle large volumes: full disk encryption, encrypted backups, or streaming data in transit.
AES (Advanced Encryption Standard) is the most widely deployed symmetric cipher. It supports 128-, 192-, and 256-bit keys and is typically used with modes like CBC (Cipher Block Chaining) and GCM (Galois/Counter Mode).
While AES is by far the most commonly used, ChaCha20 is its strongest alternative. It exists for devices that can’t accelerate AES in hardware. It’s lean and efficient, making it popular in mobile apps and embedded systems.
Symmetric encryption’s biggest limitation is key sharing. If you don’t already have a private channel to pass the key to the other party, the whole setup falls apart. That’s where asymmetric systems come in.
Asymmetric encryption (public-key encryption)
Asymmetric encryption uses two keys: a public key and a private key. They're mathematically related, but knowing one doesn’t reveal the other.
The key advantage is this: anyone can use your public key to encrypt data, but only your private key can decrypt it. This means that no shared secret needs to be exchanged beforehand. That removes the need for secure key distribution.
You publish your public key; it's open, and anyone can use it. Your private key stays with you and never leaves your device.
This system also supports digital signatures. You create a hash of the message, then encrypt that hash using your private key. You send both. The recipient decrypts your signature with your public key and compares the result to their own hash. If the two match, they know the message came from you and wasn’t changed.
Rivest-Shamir-Adleman (RSA) is one of the best-known forms of asymmetric encryption, typically used with 2048- or 4096-bit keys. It’s reliable but computationally heavy. Elliptic curve (EC) options offer equivalent security with much shorter keys and faster performance. ECDSA is used for digital signatures, while X25519 is commonly used for secure key exchange. Both are widely adopted in HTTPS handshakes, encrypted messaging, SSH connections, and other protocols that depend on speed and cryptographic identity.
Asymmetric encryption is too resource-heavy for large files or high-volume data. That’s why it’s mainly built for setup (exchanging keys, proving identity), not for doing the bulk encryption work.
Hybrid encryption systems
Most secure systems today combine the two. Asymmetric encryption is used to exchange a fresh symmetric key. After that, all communication is encrypted symmetrically.
This is what happens when you connect to a secure website. Your browser uses the site’s public key to encrypt a one-time session key. That key is then used to encrypt everything else. Many services use new session keys for each connection, which means even if someone steals the server’s private key later, they can’t go back and read past traffic. That’s called forward secrecy.
Hybrid encryption keeps things fast and secure. It’s the model used in messaging apps, VPN protocols, file-sharing tools, or anywhere you need both speed and strong protection.
Encryption for data in transit vs. data at rest
Data is either stored or moving. Each state comes with its own threats and requires different encryption strategies.
What is data-at-rest encryption?
Data at rest refers to information that isn’t actively moving, like files saved to disk, database entries, and cloud storage backups. This is what sits on your laptop, your server, or in your cloud account.
If someone gains access to the physical device or storage system, encryption is often the last defense. Tools like BitLocker on Windows or FileVault on macOS encrypt full drives. On a larger scale, many enterprise databases encrypt rows or entire tables. With cloud services, client-side encryption gives control to the user; only they hold the keys.
Without encryption, anyone with access to the storage layer can read everything. That includes backup drives, stolen laptops, and misconfigured cloud buckets.
What is encryption in transit?
Transit means data is moving between devices, across the internet, or maybe through internal networks. It includes browsing, emails, video calls, uploads, remote logins, and more.
While in motion, data can be intercepted. Cybercriminals can eavesdrop, inject malicious content, or reroute traffic. Encryption in transit protects against this by scrambling the data before it leaves the device. Protocols like TLS (for HTTPS), VPN tunnels, and end-to-end messaging apps handle this layer.
If someone captures the traffic, all they get is ciphertext. But encryption doesn’t hide everything. Metadata (like your IP address, time stamps, or packet size) can still be visible and used to infer behavior.
Real-world uses of data encryption
Encryption is built into many of the tools you already use every day. Let’s take a look:
Messaging and email
Apps like Signal, WhatsApp, and iMessage use end-to-end encryption so that only you and the person you’re talking to can read the message. Not even the service provider can decrypt it. The encryption kicks in before anything leaves your phone and stays until it reaches the recipient.
Email, on the other hand, is less secure by default. While most major services encrypt messages while they’re being transferred between servers, the messages often sit unencrypted on the servers themselves. If you want full privacy, you’ll need to use a secure email service where only the sender and recipient can read the message, because they each hold their own encryption keys.
Cloud storage and backups
Cloud providers like Dropbox or Google Drive encrypt your files once they’re uploaded, but since they manage the keys, they can technically decrypt the data if needed.
To avoid that, you can encrypt the files yourself before uploading. Tools like Cryptomator handle this on your device, making sure only you can access the files later. That way, even if the provider is breached or compelled to turn over data, your files stay locked.
Financial transactions and banking
Banks rely on HTTPS and other encryption protocols to protect login details and payment information. All online sessions are encrypted from start to finish.
For credit card payments, most systems use point-to-point encryption (P2PE). This means your card details are encrypted at the terminal the moment they’re entered. Even the merchant doesn’t see the full card number or security code. The data stays encrypted until it reaches the payment processor.
Securing remote work and BYOD devices
Remote employees usually connect to internal company systems through a VPN, which creates an encrypted tunnel between the device and the server. For personal or freelance use, commercial VPNs also rely on strong encryption to secure internet traffic. This protects browsing data, DNS requests, and online activity from eavesdropping.
On the device side, companies often require full-disk encryption for laptops and mobile phones. That way, if a device is lost or stolen, the files inside remain protected.
Should I encrypt data on my phone?
From personal messages and contact lists to email accounts, stored passwords, bank apps, and even location history, your phone holds a detailed map of your life. If the device is stolen or accessed without your permission, all of that can be exposed. Encryption prevents this by locking the contents of the phone with a cryptographic key that only the device owner knows.
How to enable encryption on Android and iOS
Most modern Android phones encrypt storage by default once you set a screen lock (PIN, password, or pattern). On some older or lower-end devices, you may still need to enable it manually.
To verify if your phone is encrypted, go to Settings > Security > Encryption, or type “encryption” in the Settings search bar. If your device shows encryption is enabled, you're covered. Exact steps may vary by model and Android version. If you're unsure, check your device manufacturer’s support site for detailed guidance.
iOS devices implement hardware-based encryption automatically. Simply setting any passcode (numeric or alphanumeric) activates full device encryption. Stronger passcodes provide better protection against brute-force attempts.
Is encrypted data 100% secure?
Encryption makes data significantly harder to access without permission. But calling it 100% secure would be misleading. Strong algorithms most certainly help, but they’re only part of the puzzle. What’s also important is how encryption is used, managed, and implemented.
Breaking well-implemented encryption through brute force is practically impossible. AES-256, for instance, remains resistant even to projected quantum threats. But real-world attacks don’t usually involve guessing keys. Instead, they exploit how the system is built or operated.
Common vulnerabilities and mistakes
- Weak key management represents a common failure point. Using predictable passwords, storing keys insecurely, or failing to rotate keys creates vulnerabilities that bypass encryption entirely.
- Implementation errors can undermine strong algorithms. Bugs in encryption software or improper random number generation may reveal sensitive information. Padding oracle attacks, which exploit poorly implemented block cipher padding validation, are another known threat if encryption is not correctly configured.
- Human error often provides the easiest attack vector. Accidentally sharing decryption keys, leaving plaintext copies of encrypted data, or misconfiguring encryption systems creates security gaps.
How to strengthen your encryption strategy
A strong encryption strategy goes beyond choosing the right algorithm. It requires careful key management, proper implementation, and disciplined security practices to truly protect your data.
Use strong, modern algorithms and secure protocols
Choose established encryption methods like AES, ChaCha20, RSA, or ECC. Use 256-bit keys for symmetric ciphers, at least 2048-bit for RSA, and 256-bit for elliptic curves. Always prefer TLS 1.2 or 1.3 over older SSL/TLS versions.
Turn off deprecated cipher suites and keep your configs aligned with current cryptographic standards. These recommendations evolve, and so should your setup.
Key management matters
Keys need to be random and unpredictable. Generate them using secure entropy sources. Store them in encrypted vaults or hardware modules (HSMs, TPMs) if you can. Lock down access. Rotate keys regularly and replace them immediately if exposed. Don’t reuse the same key across different systems or use cases. Never embed them in source code or leave them in plaintext.
Lock down access to encrypted data
Encryption is only effective if access is controlled. Use multi-factor authentication and zero-trust network access. Apply the principle of least privilege; users should only access what they need. Watch logs for unusual behavior. If someone breaks in with valid credentials, encryption won’t stop them unless access is limited.
Secure everything around the encryption
Malware can steal decrypted data. Keep systems patched and monitored, and make sure to keep your devices encrypted. Be aware that decrypted data often sits in RAM or temp files. Wipe temp storage, and secure your endpoints because that’s where data can be exposed.
Can quantum computers break encryption?
Quantum computers pose a future threat to current symmetric encryption methods. Sufficiently powerful quantum computers could break RSA and elliptic curve cryptography using Shor’s algorithm, though such computers don’t exist yet.
Symmetric encryption like AES-256 offers some resistance to quantum attacks. This is because to break it, attackers would still have to guess the correct key. Grover’s algorithm reduces the time a quantum computer would require to do this by half. This means AES-128 offers only 64-bit security against quantum attacks, while AES-256 offers an effective 128-bit quantum-resistant strength. Even so, AES-256 is considered secure based on current publicly known quantum capabilities, largely due to its large key size.
Is data encryption required for compliance?
Most regulatory frameworks treat encryption as a key part of data protection. While not always mandated outright, it’s often the deciding factor in whether an incident counts as a reportable breach.
Encryption under GDPR, HIPAA, and other regulations
The General Data Protection Regulation (GDPR) refers to encryption as an “appropriate technical measure” under Article 32. It doesn’t make it mandatory in every case, but if breached data is encrypted, notification requirements can often be waived. Regulators view the data as unreadable, reducing risk to affected individuals.
The Health Insurance Portability and Accountability Act (HIPAA) treats encryption as addressable; you must implement it when reasonable or explain why not (45 CFR §164.312). Per The HIPAA Journal, if electronic protected health information (ePHI) is encrypted to NIST standards (SP 800-111 for data at rest, SP 800-52 for TLS configurations securing data in transit), breached data may qualify for safe harbor, avoiding individual breach notifications.
The Payment Card Industry Data Security Standard imposes stricter requirements. It calls for strong encryption (defined as industry-accepted algorithms and key lengths that meet evolving cryptographic standards) whenever cardholder data is stored or transmitted across public networks. Organizations handling payment data that fail to comply face penalties, audit failures, and potential loss of processing capabilities.
FAQ: Common questions about data encryption
Is encryption the same as cryptography?
Not exactly. Cryptography covers a range of techniques for securing information; encryption is just one of them. Hashing, signatures, and authentication protocols are also part of the field.
What is the best type of encryption?
That depends on the goal. AES-256 is strong and efficient for securing large volumes of data, while RSA or elliptic curves handle key exchange. Most modern systems use both.
Can I encrypt individual apps or files?
Yes, tools like VeraCrypt support file- or folder-level encryption. Full-disk options like FileVault or BitLocker encrypt everything but may include file container features. Many apps also encrypt their own local data.
What happens if I lose my encryption key?
You won’t get the data back. Without the right key or recovery setup, the contents stay unreadable even to you.
What happens if your phone is not encrypted?
Without encryption, anyone with physical access can extract your personal data using forensic tools. Even after a factory reset, unencrypted devices may retain recoverable personal data that strong encryption would have permanently protected.
However, most modern smartphones encrypt data by default, making it extremely difficult to access without the passcode. Some older or region-specific Android models may still require manual activation.
Can encrypted data be deleted permanently?
Yes, if you handle it properly. Just dragging files to the trash and then emptying the bin isn’t enough. Information stays on the disk (and is recoverable) until it’s overwritten by other data.
When both the encrypted data and its decryption key are removed beyond recovery, the information is considered gone. Crypto-shredding alone works if you’re confident the keys are unrecoverable. But pairing that with secure deletion of the files themselves gives you more certainty, especially in environments with strict compliance needs.
Take the first step to protect yourself online. Try ExpressVPN risk-free.
Get ExpressVPN