liveBook · Manning

Symmetric key encryption

As explained in Software Security for Developers

Symmetric key cryptography uses the same secret key, or closely related shared keys, to protect and recover data.

Symmetric-key encryption transforms readable plaintext into ciphertext with a secret key, then uses the same key to decrypt it. The algorithm can be public; protecting the key is essential. section 5.1

Protecting stored application data

AES is the practical default for encrypting data in cloud applications, databases, and disks. For secure application encryption, use AES-GCM with a secret key and a random, unique IV; the authentication tag detects tampering as well as protecting confidentiality. section 5.1 section 5.7

Avoid these common symmetric-encryption failures:

  • Do not reuse an IV with the same key; use cryptographically secure randomness. section 5.7
  • Do not use ECB for patterned data, or CBC when integrity and authenticity are required. section 5.7
  • Prefer developer-friendly cryptographic libraries over hand-coding AES. section 5.7
Figure 5.1 A cipher consists of an algorithm and a key for encrypting and decrypting data. The details of the encryption and decryption algorithm are public knowledge; the key is secret. If the same key is used to encrypt and decrypt, the cipher is called a symmetric cipher; otherwise, it’s called an asymmetric cipher.
figure

A cipher combines a public algorithm with a secret key; using that key for both operations makes the cipher symmetric. section 5.1

How Software Security for Developers covers it

How deep it goes
Explains plaintext, ciphertext, keys, AES modes, IVs, authentication tags, and practical configuration risks.
Examples
Uses AES block encryption, ECB and CBC failure modes, AES-GCM, IVs, authentication tags, and Java Cipher.
What it assumes
Teaches encryption, decryption, plaintext, ciphertext, and symmetric keys from basic definitions.
What you can do after
Apply AES-GCM through a developer-friendly library while avoiding insecure modes and IV reuse.
How it connects
Connects symmetric encryption with AES, authenticated encryption, TLS, JOSE, and asymmetric encryption.

Also explained in

Compare how 6 books explain symmetric key encryption →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Security for Developers. The section links point to the parts of the book it draws on.