liveBook · Manning

Symmetric key encryption

As explained in Hacking Cryptography

Cryptography in which communicating parties use the same secret key or shared secret for corresponding cryptographic operations.

Symmetric-key encryption protects confidentiality by using one shared secret key for both encryption and decryption. An eavesdropper sees ciphertext intended to resemble random bytes, while the algorithm itself must remain secure even when publicly known. section 1.2.1 section 8.1

Figure 1.2 Using symmetric keys for encryption and decryption
figure

Trace the same secret key through encryption and decryption. section 1.2.1

Stream ciphers and block ciphers are the two major categories. Both reduce the secret-key material required by a one-time pad: an OTP can be theoretically unbreakable, but its random key must be as long as the plaintext and never reused. section 8.1 section 8.1

Engineering constraints shape how the primitive is deployed:

  • Keep the shared key private between intended participants; securely exchanging that key over an insecure channel remains the central unresolved problem. section 8.1
  • Prefer publicly auditable algorithms and implementations rather than relying on hidden designs or source code for security. section 1.2.1
  • Use symmetric keys for performance, while recognizing that asymmetric cryptography can address key distribution and can wrap symmetric keys. section 8.5 section 8.1

A shared secret protecting an API request

A message authentication code uses a secret key shared by sender and receiver. The receiver recalculates the MAC, while an attacker who lacks the key cannot forge a valid value for modified data. Password-reset links can carry an account name, expiry timestamp, and MAC. section 7.1 section 7.1

How Hacking Cryptography covers it

How deep it goes
Explains the shared-key model, OTP tradeoff, cipher categories, Kerckhoff’s principle, and key exchange, but not cipher internals.
Examples
Uses an encryption/decryption flow, a one-time-pad comparison, and MAC-protected API and password-reset messages.
What you can do after
Evaluate symmetric encryption’s confidentiality, performance, key-material requirements, and secret-key distribution risks.
How it connects
Connects confidentiality with stream ciphers, block ciphers, one-time pads, asymmetric cryptography, and message authentication codes.

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 Hacking Cryptography. The section links point to the parts of the book it draws on.