What is Data Encryption at Rest and In Transit?

Last updated: July 2026

Encryption at rest is a control that makes stored data unreadable without keys; encryption in transit protects data crossing networks. Data lives in three states — at rest on storage, in transit on the wire, and in use in memory — and the first two are every application’s baseline obligation: AES-256 for what sits, TLS for what moves. The third state (protected by trusted execution environments and, at the frontier, homomorphic encryption) is real but, for most application teams, someone else’s layer.

Key takeaways

QuestionAnswer
At restAES-256 on disks, databases, backups — against stolen media
In transitTLS 1.2+ on every connection — against wiretaps and MITM
The blind spotNeither stops a compromised app — encryption is not access control
The real problemKey management — keys stored next to data are theater
The confusion to retirePasswords are hashed (bcrypt/argon2), never encrypted

The two protections — and what each actually stops

The honesty table the ranking pages omit — including the column that matters most:

             Standard         Covers                   Stops                    Does NOT stop
In transit   TLS 1.2+/HTTPS   every network hop        wiretaps, MITM,          compromised endpoints —
                                                       coffee-shop snooping     the server reads it fine
At rest      AES-256 (GCM)    disks, DBs, backups      stolen drives, leaked    stolen credentials,
                                                       backups, open buckets    SQL injection, app bugs
In use       TEEs             RAM during processing    memory scraping          — mostly a platform concern

Neither stops an attacker the app itself trusts. The app holds keys and
decrypts on demand — encryption complements access control, never replaces it.

What the defaults look like from application code:

// JavaScript / Node.js — Back4app JS SDK
// Every SDK call rides TLS — and passwords are HASHED, never stored readable
const user = new Parse.User();
await user.signUp({ username: 'ada', password: secret });
// On the wire: TLS 1.2+ (the https serverURL is the whole config)
// At rest: bcrypt hash — even the database never holds the password itself

// Extra-sensitive fields: encrypt server-side in a Cloud Code beforeSave
// so plaintext never reaches storage — AES-256-GCM, key in env, not in code

How TLS works, in one paragraph

The elegant trick: asymmetric cryptography is slow but needs no shared secret; symmetric is fast but needs one. So the TLS handshake uses the first to establish the second — the client verifies the server’s certificate (the identity check that makes interception detectable), both sides agree on a fresh session key via asymmetric key exchange, and everything after rides fast symmetric encryption. TLS 1.3 tightened all of it: one round trip instead of two, legacy ciphers and RSA key exchange removed, forward secrecy mandatory — so recorded traffic can’t be decrypted later even if the server’s long-term key leaks. Mobile addendum the SERP skips: apps can additionally pin expected certificates, trading resilience against rogue certificate authorities for operational care at rotation time.

The at-rest layers: disk vs. database vs. field vs. application

“Encrypted at rest” spans four very different promises — each defeating a different attacker:

LayerHowDefeatsDoesn’t touch
Full-disk (LUKS/dm-crypt)OS encrypts the volumeStolen/discarded hardwareAnyone on the running system
Transparent (TDE)Database encrypts files as writtenStolen data files and backupsAnyone with database credentials
Field/column-levelSpecific columns encrypted, app holds keysCurious DBAs, broader DB breachesCompromise of the app itself
Application-levelEncrypted before reaching storageEverything below the appThe app and its key store
Envelope encryption keeping keys separate from dataApplication data is encrypted with a data encryption key. The data key is itself encrypted by a key-encryption key held in a key management service or hardware security module, so a stolen database contains ciphertext and wrapped keys but nothing that decrypts without the separately guarded key service.

AES-256-GCM

encrypts

wraps

holds

gets ciphertext +
wrapped keys — nothing opens

Data

Ciphertext
in database

Data key (DEK)

Key-encryption key (KEK)

Key service / HSM
separate system, audited

Thief with the database

Application data is encrypted with a data encryption key. The data key is itself encrypted by a key-encryption key held in a key management service or hardware security module, so a stolen database contains ciphertext and wrapped keys but nothing that decrypts without the separately guarded key service.

The rule down the whole table: higher layers protect against more, cost more. Field-level encryption is the honest trade — encrypted columns can’t be indexed or searched normally (deterministic encryption restores equality lookups at some leakage cost) — which is why it’s reserved for the genuinely sensitive: health data, government IDs, secrets. And the classic audit failure lives here: the encrypted database whose backups ship unencrypted.

End-to-end encryption is a different promise

TLS everywhere still means the server reads everything — it decrypts each connection by design. End-to-end encryption moves the keys to the users: only sender and recipient can decrypt, and the operator serves ciphertext it cannot open. That’s a different product decision, not a stronger setting: E2EE means no server-side search, no content moderation, no recovery if users lose keys. The threat models nest cleanly — TLS defends the path, at-rest defends the storage, E2EE defends against the service itself — and most applications correctly stop at the first two while messaging and vault products justify the third.

Hashing vs. encryption

EncryptionHashing
ReversibleYes — with the keyNo — by design
Right forData you must read backPasswords, integrity checks
StandardsAES-256-GCMbcrypt, scrypt, argon2 (slow + salted)
The failureLosing or leaking keysFast unsalted hashes (MD5, plain SHA-256)

One callout retires a widespread confusion: passwords are hashed, never encrypted. Nobody — including the server — should be able to recover a password; login compares hashes. Encrypting passwords means a key exists that decrypts them all, which is exactly the catastrophe hashing exists to preclude.

Common use cases

  • Every web and mobile app — TLS on all connections and encrypted storage are table stakes, not features.
  • Regulated data — GDPR names encryption an appropriate technical measure (with breach-notification relief), health rules mandate it for patient data, and payment standards require unreadable card numbers at rest and strong crypto in transit.
  • Backups and decommissioning — encrypted backups and crypto-shredding (destroy the key, the data dies everywhere) close the stolen-copy chapter.
  • PII field protection — application-level encryption for the columns whose leak is a headline, not an incident.
  • Mobile clients on hostile networks — TLS plus certificate validation as the defense that travels with the user.

Which layer do you need? A decision matrix

SituationReach for
Any data, any appTLS everywhere + platform at-rest encryption — the floor
Stolen-backup nightmareEncrypted backups + keys stored elsewhere
Sensitive columns (health, IDs)Field/application-level encryption, keys in env or KMS
”Even we shouldn’t read it”End-to-end encryption — accept the product costs
PasswordsHashing (bcrypt/argon2) — never encryption
Access concerns, not theft concernsACLs and row-level security — encryption won’t help

Limitations and trade-offs

  • Encryption is not access control. The layered-security point in one line: at-rest encryption is transparent to the running app, so permissions — ACLs, CLPs, row policies — remain the defense against every credentialed attacker.
  • Key management is the real project. NIST’s guidance exists because generation, separation, rotation, and revocation — not algorithm choice — are where deployments fail.
  • Field-level encryption fights the database. No indexes, no LIKE queries, careful migrations; encrypt the fields that need it, not the schema.
  • TLS ends at the terminator. Proxies and load balancers that decrypt mid-path recreate plaintext hops; internal traffic needs the same discipline as the edge.
  • Compliance ≠ security. Checkbox encryption with keys beside the data satisfies auditors and no one else; the threat-model column is the one to design against.

Encryption on Back4app

Back4app is an open-source Backend-as-a-Service (BaaS) platform that combines a managed database, auto-generated REST and GraphQL APIs, authentication, file storage, and Cloud Code serverless functions. The floor is platform-provided: every REST, GraphQL, and Live Query connection rides TLS, and data and backups are encrypted at rest — the two baseline layers arrive as defaults rather than projects. The developer’s remaining share is exactly what the code tabs sketch: passwords are bcrypt-hashed by Back4app out of the box (never stored, never recoverable — the hashing rule enforced structurally); truly sensitive fields get application-level encryption in a Cloud Code beforeSave, with the key in server-side configuration rather than code, so plaintext never reaches storage; and secrets stay out of logs, URLs, and client bundles — the API-key discipline applied to data. Then the piece encryption cannot do: ACLs and class-level permissions govern who reads what, because the control that stops a credentialed attacker was never cryptography — it was authorization.

Frequently asked questions

What is encryption at rest?

Encrypting stored data — disks, databases, backups, object storage — so that whoever obtains the storage medium without the keys holds ciphertext. The standard is AES-256; the protection is against stolen hardware, leaked backups, and breached storage layers.

What is encryption in transit?

Encrypting data while it crosses networks so intercepted traffic is unreadable — the job of TLS, which is what the S in HTTPS delivers. It protects against eavesdropping and man-in-the-middle attacks on any hop between client and server.

What is the difference between encryption at rest and in transit?

Different data states, different threats. At-rest defends stored copies against theft of media and backups; in-transit defends moving data against wiretapping. They are complements, not alternatives — every serious security framework expects both, because each stops attacks the other cannot see.

Is HTTPS the same as TLS?

HTTPS is HTTP carried over TLS, the cryptographic protocol securing the connection. TLS 1.3 is current — faster handshakes, weak ciphers removed, forward secrecy mandatory; versions 1.0 and 1.1 are formally deprecated and should be disabled.

What is AES-256?

The Advanced Encryption Standard with a 256-bit key — a symmetric block cipher standardized by NIST, effectively immune to brute force, and the de facto choice for data at rest. In practice you want an authenticated mode like AES-GCM, which detects tampering as well as hiding content.

What is the difference between symmetric and asymmetric encryption?

Symmetric uses one shared key for both directions — fast, right for bulk data (AES). Asymmetric uses a public/private key pair — slower, right for key exchange, certificates, and signatures. TLS uses both: an asymmetric handshake agrees on a symmetric session key that encrypts the actual traffic.

How is end-to-end encryption different from encryption in transit?

Scope of trust. TLS protects each hop, but the server decrypts and can read everything. End-to-end encryption means only the communicating users hold keys — the service operator itself cannot read content. E2EE protects against the server; TLS protects the path to it.

Does encryption at rest protect against hackers?

Only against a specific kind: those who obtain the storage — stolen drives, leaked backups, misconfigured buckets. An attacker who compromises the application or steals credentials reads data freely, because the app decrypts legitimately. Encryption is not access control; it complements ACLs, never replaces them.

What is the difference between hashing and encryption?

Encryption is reversible with a key; hashing is deliberately one-way. Passwords must be hashed — with slow, salted algorithms like bcrypt or argon2 — never encrypted, because no one, including the server, should ever be able to recover them.

What is encryption key management?

The discipline that decides whether the cryptography means anything: generating keys properly, storing them separately from the data (envelope encryption — data keys wrapped by key-encryption keys in a managed service or HSM), rotating them, and revoking them. A key in a config file next to the database is theater, not protection.

Related terms

Compare with

Further reading

Ready to build your backend?

Start your project on Back4app in minutes — database, auth, APIs, and Cloud Code included. No credit card required.

Written and reviewed by Back4app Engineering, Back4app Engineering · Published 2026-07-30