liveBook · Manning

Key rotation

As explained in Software Security for Developers

Key rotation is the replacement of cryptographic keys with new keys according to a planned security lifecycle.

Key rotation replaces cryptographic keys according to a planned lifecycle. In a service-to-service system, manually changing one shared secret in multiple services creates coordination work and gives one service too much control. section 6.4

A public-key design makes rotation easier by separating distribution responsibilities:

  • The payment service holds the RSA private key and exposes its public key through an endpoint. section 6.4
  • The warehouse service encrypts refund details with the public key; the payment service decrypts them with the private key. section 6.4
  • Rotating the pair avoids updating the same secret manually in two places and reduces secret sharing across services. section 6.4

ACME refund processing

ACME encrypts refunds.json in the warehouse service and sends it to the payment service. With AES, both sides must retain the same secret key. With RSA, the warehouse uses a configured public key while the payment service retains the private key, illustrating a more manageable rotation boundary. section 6.4

How Software Security for Developers covers it

How deep it goes
Explains the operational rationale and demonstrates key-pair generation, but stops short of implementing a rotation endpoint.
Examples
Demonstrates an ACME warehouse-to-payment refund flow using refunds.json and an RSA key pair.
What it assumes
Assumes familiarity with symmetric encryption while demonstrating RSA key-pair generation and service encryption from practical Java examples.
What you can do after
Operate/configure a basic RSA-based service exchange with separate public and private key files.
How it connects
Connects key rotation with RSA, AES, public-key encryption, private keys, public keys, and zero-trust.

Also explained in

Compare how 2 books explain key rotation →

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.