Symmetric encryption transforms readable plaintext into ciphertext using a secret key and reverses the transformation using the same key. Unlike asymmetric encryption, it does not use a public and private key pair. Algorithms such as the Advanced Encryption Standard, or AES, efficiently process large amounts of data, making symmetric encryption a common choice for protecting database storage, objects, disk volumes, and application payloads.
The algorithm does not need to be secret; the key does. Generate keys using a cryptographically secure random source rather than embedding passwords or predictable strings in application code. Anyone who obtains the key and the necessary encryption metadata can potentially decrypt the data. Keep plaintext keys out of source control, logs, persistent configuration, and diagnostic output, and restrict access to both keys and key-management APIs.
Cloud systems commonly use envelope encryption. A data key encrypts the payload, and a separate key-encryption key protects the data key. The encrypted data key can be stored alongside the encrypted payload. This separates efficient bulk encryption from key protection and allows a key management service to centralize authorization and auditing without processing the entire payload.
For example, an application can call AWS Key Management Service GenerateDataKey using a symmetric encryption KMS key. The response contains a plaintext data key and an encrypted copy. The application encrypts a document locally using the plaintext data key and a vetted encryption library, removes the plaintext key from memory as soon as practical, and stores the encrypted data key with the ciphertext and required metadata. To read the document, an authorized application calls KMS Decrypt on the encrypted data key, then uses the returned plaintext key to decrypt the document locally. The KMS key itself is not returned to the application.
Direct encryption and envelope encryption suit different workloads. AWS KMS Encrypt accepts at most 4,096 bytes of plaintext when using a symmetric encryption KMS key, so it is suitable for small values rather than entire large files. Envelope encryption supports larger payloads while avoiding transmission of the whole payload to KMS. Key-management requests still introduce latency, costs, and quota considerations, so use established libraries and service integrations rather than implementing a custom cryptographic protocol.
An algorithm name alone does not specify a secure implementation. Authenticated encryption, such as AES-GCM, provides confidentiality and detects unauthorized changes to ciphertext and associated authenticated data. Never reuse a nonce with the same AES-GCM key. Preserve the nonce, authentication tag, encrypted data key, and other metadata required by the encryption format; these values generally do not need to be secret.
AWS KMS encryption context supplies additional authenticated data for supported symmetric cryptographic operations. When context is used to encrypt, decryption requires the same case-sensitive key-value pairs, although their order does not matter. Context can bind ciphertext to an application or tenant and support authorization conditions, but it is not secret and can appear in audit logs. Never place passwords or sensitive personal information in it.
Managed storage encryption reduces application implementation work, but key-management details differ. Amazon S3 SSE-S3 uses S3-managed keys, whereas SSE-KMS integrates with AWS KMS. In either case, authorized object reads return plaintext, so encryption does not replace resource access controls. Likewise, storage encryption does not automatically protect application network traffic; use TLS for transport protection.
Symmetric encryption is reversible with the key, unlike hashing, and it does not by itself prove which individual created a message because multiple parties may share the key. Plan key rotation and retention separately from data retention. Rotating a KMS key does not automatically re-encrypt existing ciphertext; supported KMS rotation retains previous key material for decryption. Deleting a required key can make dependent data permanently unrecoverable.