CLOUD CONCEPT

Client-Side Encryption

Client-side encryption encrypts data in the application or client environment before sending it to a cloud storage or data service.

Cloud Concepts Hub →

What is Client-Side Encryption

The receiving service stores ciphertext rather than the original plaintext, and authorized clients decrypt the data when they retrieve it. This separates access to stored data from access to its plaintext, but requires deliberate choices about key custody, application security, and recovery.

Client-side encryption places the encryption operation before the boundary of the receiving storage service. The client might be a desktop application, an on-premises backup agent, or an application running on cloud compute. It encrypts data locally and sends ciphertext to object storage or a database. On retrieval, an authorized application obtains the necessary key material and decrypts the data. The term describes where encryption happens; it does not necessarily mean that the application runs outside the cloud provider.

A common implementation uses envelope encryption. The application obtains a symmetric data key, encrypts the payload using an authenticated encryption algorithm such as AES-GCM, and protects the data key with a separate wrapping key. It stores the ciphertext, encrypted data key, and required cryptographic metadata together. During retrieval, the application unwraps the data key and decrypts the payload. Use maintained encryption libraries rather than inventing a message format, and follow their requirements for nonces, integrity verification, and algorithm selection. Plaintext data keys must not appear in logs, configuration files, or stored objects, and their lifetime in memory should be minimized.

Key management depends on the requirement. AWS KMS can generate data keys and protect them under a KMS key while the application performs bulk encryption locally. This provides policy enforcement and auditing for KMS operations, but it still relies on a provider-operated key service. If a requirement says that no plaintext key material may leave an HSM, a workflow that returns a plaintext data key to application memory does not satisfy it. AWS CloudHSM supports customer-controlled HSM operations, but engineers must choose an HSM-compatible cryptographic workflow and validate performance and availability. If keys must remain entirely outside the cloud provider, an external key system may be necessary.

For example, a backup agent can encrypt an archive before uploading it to object storage. A storage administrator who can download the object still cannot read the archive without the decryption capability. Keep storage permissions and key-use permissions separate, and restrict decryption to the recovery application. A database application can similarly encrypt sensitive fields before writing records, although queries and indexes cannot operate normally on those ciphertext fields without additional, carefully designed mechanisms.

Client-side encryption differs from server-side encryption, where the receiving service performs encryption after receiving the data. Supplying a customer key to a service for server-side encryption does not make the operation client-side; Amazon S3 SSE-C is an example. Likewise, TLS protects data in transit but does not determine whether the service receives plaintext. Client-side encryption should still use TLS, access controls, and appropriate server-side encryption as complementary protections.

The trade-offs include application CPU usage, larger payloads, encryption-library maintenance, and more complex recovery and key lifecycle management. Losing the required keys can make backups permanently unreadable. Rotating a wrapping key does not automatically re-encrypt existing payloads; the migration strategy depends on the encryption format and key service. Client-side encryption also limits service-side inspection, transformation, and plaintext search. It does not hide unencrypted object names, record attributes, or other exposed metadata, and it cannot protect plaintext from a compromised client that is authorized to decrypt it. For exam scenarios, select it when encryption must occur before storage-service ingestion, then separately evaluate key custody, authorization, and operational requirements.

Key aspects of Client-Side Encryption

Client-side encryption moves payload protection into the application while making key authorization, cryptographic correctness, and recoverability explicit engineering responsibilities.

Encryption before service ingestion

The application encrypts the payload before sending it to the receiving data service. A cloud-hosted application can still perform client-side encryption relative to the storage service it uses.

Independent storage and decryption permissions

Permission to retrieve ciphertext does not inherently grant permission to decrypt it. Separate storage access from key-use authorization and avoid giving storage administration roles unnecessary decryption privileges.

Envelope encryption

A data key encrypts the payload, while a wrapping key protects the data key. Store the encrypted data key and required metadata with the ciphertext, but never persist the plaintext data key.

Explicit key custody

Client-side encryption can use managed key services, customer-controlled HSMs, or external key systems. Choose the model according to requirements for provider trust, key exportability, and where plaintext key material may exist.

Authenticated ciphertext

Use maintained libraries and authenticated encryption to detect unauthorized changes to encrypted data. Follow the library's rules for nonce generation and verify integrity before accepting decrypted output.

Application and recovery responsibility

Clients must manage encryption formats, decryption compatibility, and key availability. Test recovery from encrypted backups and account for limitations on server-side search, indexing, and processing.

Cloud services for Client-Side Encryption

Amazon S3 and Amazon DynamoDB can store ciphertext produced by applications before ingestion. AWS KMS commonly supplies the key-management layer for envelope encryption, allowing applications to encrypt payloads locally while controlling access to data-key generation and decryption. AWS CloudHSM supports designs requiring dedicated HSMs and customer-controlled cryptographic operations, with additional integration and operational responsibilities. Across these services, engineers must separate storage permissions from decryption permissions, preserve encryption metadata, and test recovery. Service-side encryption remains a complementary control rather than a substitute for encryption before ingestion.

Amazon Simple Storage Service image Amazon S3

Applications can encrypt objects before uploading them to Amazon S3, including through an appropriate S3 encryption client. S3 stores the ciphertext and can additionally apply server-side encryption; neither SSE-KMS nor SSE-C is itself client-side encryption.

Open Amazon S3 →
AWS CloudHSM image AWS CloudHSM

AWS CloudHSM provides dedicated HSMs that applications can use for cryptographic operations and key protection in a client-side encryption design. Whether plaintext data keys leave the HSM depends on the implementation; using CloudHSM does not by itself establish the encryption boundary.

Open AWS CloudHSM →
Amazon DynamoDB image Amazon DynamoDB

Applications can encrypt selected attributes before writing them to DynamoDB, using tools such as the AWS Database Encryption SDK for DynamoDB. Encrypted attributes have query limitations, so key attributes and any intentionally exposed fields must be considered explicitly.

Open Amazon DynamoDB →