Security Fundamentals: Data Protection · 4 of 5
Encryption at Rest vs in Transit
Encryption protects data in two different moments: while it is stored and while it is moving.
Data is useful because people and systems can read it, copy it, search it, and send it somewhere else. Those same qualities make it vulnerable. Encryption is the practice of making data unreadable to anyone who does not have the right secret, but the word hides an important distinction: stored data and moving data face different risks, use different controls, and fail in different ways.
Start with plaintext, ciphertext, and keys
Encryption begins with a simple problem. You have readable data, called plaintext. You want to turn it into unreadable data, called ciphertext, so that a person who steals or intercepts it cannot understand it. The mathematical process that performs this transformation is an algorithm. The secret value that controls the transformation is a key.
The algorithm is usually public knowledge. The key is the part that must be protected. This is not a weakness; it is a design goal. Modern encryption assumes attackers may know the method, but they should not be able to recover the plaintext without the key.
The phrase encryption at rest means protecting data while it is stored. The phrase encryption in transit means protecting data while it travels from one place to another. Both use the same basic idea, but they protect different moments in the life of data.
What encryption at rest protects
Data at rest is data that has been written somewhere and is waiting to be used later. It may live on a laptop drive, a server disk, a database file, an object store, a backup tape, a memory snapshot, or a log archive. If someone can take a copy of that storage, encryption at rest is meant to make the copy useless without the key.
There are several layers where at-rest encryption can be applied. Full-disk encryption protects an entire device or volume. Database encryption protects database files or tablespaces. Application-level encryption protects selected fields before the database ever sees the readable value. Backup encryption protects copies that may travel through different systems and outlive the original data.
The layer matters. Full-disk encryption helps if a drive is removed from a powered-off machine, but it may not protect against a user or process that can query a running database. Field-level encryption can limit what database administrators or stolen database dumps reveal, but it requires careful application design and key handling.
What encryption in transit protects
Data in transit is data moving between systems. A browser sends a password to a website. A mobile app calls an application programming interface, or API. One service calls another service inside a data center. A database client sends a query to a database server. Each trip creates an opportunity for someone on the path to read, modify, or impersonate traffic.
The most common protection for data in transit on the web is Transport Layer Security, or TLS. When you see Hypertext Transfer Protocol Secure, or HTTPS, you are seeing Hypertext Transfer Protocol, or HTTP, carried inside TLS. TLS provides confidentiality so observers cannot read the traffic, integrity so tampering is detected, and authentication so the client can gain confidence it is talking to the right server.
Transit encryption is not only for the public internet. Internal networks are not magic safe zones. Misconfigured routers, compromised hosts, shared network segments, packet captures, and cloud account mistakes can all expose internal traffic. For sensitive systems, encrypting service-to-service traffic is often as important as encrypting user-to-service traffic.
Keys are the center of the system
Encryption does not make data disappear. It moves the problem from protecting every copy of the data to protecting the keys that can unlock those copies. That is a better problem, because keys are smaller, easier to rotate, easier to restrict, and easier to monitor than all the data they protect.
A key management system, or KMS, is the set of tools and processes used to create, store, use, rotate, disable, and destroy keys. Some organizations use dedicated hardware security modules, or HSMs, which are tamper-resistant devices designed to protect cryptographic keys and operations. Others use software-based key stores, cloud key services, or combinations of these approaches.
Good key management separates duties. The system that stores encrypted data should not casually expose the keys. The people who administer storage should not automatically be able to decrypt sensitive records. Applications should receive only the key access they need, for the time they need it, and key use should be logged.
What encryption does not solve
Encryption is powerful, but it is not a complete security program. If an attacker logs in as an authorized user, the system may decrypt the data for them. If an application has a flaw that exposes records through a legitimate query, encryption at rest may not help. If malware runs on a machine after data is decrypted, it can often read the plaintext like any other program.
Transit encryption has similar limits. TLS can protect a connection, but it cannot prove that the person using the client is trustworthy. It cannot fix a server that sends data to the wrong recipient. It cannot protect data after it arrives and is written to logs, caches, analytics tools, or support exports.
This is why encryption works best with access control, identity management, secure software design, monitoring, and data minimization. The goal is not to say encryption is weak. The goal is to put it in the right place in the larger system.
- Encryption does not stop misuse by a valid account that is allowed to decrypt.
- Encryption does not remove sensitive data from logs or exports after decryption.
- Encryption does not replace patching, input validation, least privilege, or monitoring.
- Encryption does not help if the keys are stored carelessly beside the data.
The decisions leaders and practitioners actually face
The practical question is rarely whether encryption is good. It is where to apply it, who controls the keys, what failures it should withstand, and how much operational complexity the organization can manage. A simple default is useful: encrypt sensitive data at rest, encrypt sensitive data in transit, and be explicit about any exception.
For at-rest encryption, teams must decide the layer. Full-disk or storage-level encryption is often a baseline because it is broad and operationally simple. Database or field-level encryption may be needed for higher-risk data such as payment details, health records, national identifiers, secrets, or credentials. Backups deserve special attention because they often cross environments, persist for years, and are restored under stress.
For transit encryption, teams must decide the boundaries. Public-facing traffic should use TLS. Internal service traffic should be assessed based on sensitivity, network exposure, and the consequences of interception or impersonation. Some environments require mutual Transport Layer Security, or mTLS, where both sides of a connection prove their identity rather than only the server proving itself to the client.
The hardest decisions are usually about keys. Who can create them? Who can use them? Can administrators decrypt customer data? How are keys rotated without downtime? What happens if a key is suspected to be exposed? What happens if a key is destroyed by mistake? These are business continuity and governance questions as much as technical ones.
- Classify the data before choosing the encryption layer.
- Treat backups, logs, and exports as first-class copies of the data.
- Prefer managed, audited key handling over keys in configuration files or source code.
- Document exceptions, because undocumented plaintext becomes permanent surprise risk.
- Test restore, rotation, and revocation procedures before an incident.
How to tell whether it is working
Do not rely on the statement that a system is encrypted. Verify the path and the storage. For data in transit, check that clients require TLS, weak protocol versions are disabled, certificates are valid, hostnames are verified, and redirects do not briefly expose sensitive data over unencrypted HTTP.
For data at rest, confirm what layer is encrypted and what is not. A database may be encrypted while logs are not. A disk may be encrypted while application exports are not. A backup may be encrypted but restored into a test environment with weaker controls. The question is not simply, is encryption on; it is, which copies are protected under which conditions.
Finally, test the failure cases. Try to read a copied storage volume without keys. Try to connect to a service without TLS. Rotate a key in a controlled setting. Disable a certificate before it expires in production. Review logs for key use. Security controls become real when the team can operate them under pressure.
Key takeaways
- Encryption at rest protects stored data; encryption in transit protects data moving between systems.
- The key is the real secret, so key management is central to whether encryption works.
- Storage-level encryption is broad, but field-level encryption can reduce exposure from databases, exports, and administrators.
- Transport Layer Security, or TLS, protects network conversations, but it does not protect data after it is decrypted at an endpoint.
- Encryption does not replace access control, secure application design, monitoring, or data minimization.
- Verification should cover every copy of the data, every network path, and the operational procedures for rotation and recovery.
Glossary
- Plaintext
- Readable data before it has been encrypted or after it has been decrypted.
- Ciphertext
- Data that has been transformed by encryption so it cannot be understood without the right key.
- Key
- A secret value used by an encryption algorithm to lock or unlock data.
- Encryption at rest
- Encryption used to protect data while it is stored on disks, databases, backups, or other storage systems.
- Encryption in transit
- Encryption used to protect data while it travels across a network between systems.
- Transport Layer Security
- A protocol, often called TLS, that encrypts network connections and helps verify the identity of the server.
- HTTPS
- Hypertext Transfer Protocol Secure, which is ordinary web traffic carried inside Transport Layer Security.
- Key management system
- The tools and processes used to create, protect, rotate, audit, and destroy encryption keys.
- Hardware security module
- A specialized tamper-resistant device used to protect cryptographic keys and perform sensitive cryptographic operations.