liveBook · Manning

Encryption

As explained in Spring Security in Action, Second Edition

Encryption is the transformation of readable data into ciphertext using a cryptographic key so that only authorized parties can recover the original data.

Encryption protects sensitive data by transforming readable input into ciphertext with a cryptographic key. Decryption uses a known function and the appropriate key to recover the input. Applications use it for persisted data and for data exchanged between system components, keeping encoded data accessible only to privileged entities. section 1.2 section 1.1

Distinguish encryption from related transformations:

  • Encoding transforms input generally; encryption is encoding that requires a key and supports later reversal through decryption. section 4.1.4
  • Symmetric encryption uses the same key for encryption and decryption. section 4.1.4
  • Asymmetric encryption uses a public key for encryption and a private key for decryption; together they form a key pair. section 4.1.4
  • Hashing is one-way encoding: applications can match an input against an output but cannot recover the input from the output. section 4.1.4

Keyed transformation

Represent encryption as (x, k) -> y, where x is the readable input, k is the key, and y is the ciphertext. Decryption applies the known reverse function to (y, k) and recovers x. section 4.1.4

(x, k) -> y 

Use the compact function notation to track the input, key, and encrypted result before considering decryption. section 4.1.4

How Spring Security in Action, Second Edition covers it

How deep it goes
Defines encryption, decryption, symmetric keys, and asymmetric key pairs, then contrasts encoding and hashing without detailing algorithm internals.
Examples
Uses stored secrets, component-to-component communication, and the keyed transformation (x, k) -> y as examples.
What you can do after
Evaluate encryption against hashing and encoding, and recognize whether a scenario requires symmetric or asymmetric keys.
How it connects
Connects encryption with encoding, hashing, decryption, data at rest, data in transition, and Spring Security components.

Also explained in

Compare how 16 books explain encryption →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring Security in Action, Second Edition. The section links point to the parts of the book it draws on.