Cryptography and keys
Encrypt every connection and stored secret with standard algorithms, keep keys in a key service, renew certificates by machine and plan for quantum.
- Required 2
- Recommended 6
Required
Encrypt data on the wire and on disk
APS-54Encrypt every connection, including those between your own servers. Encrypt stored personal data and backups.
Renew certificates automatically
APS-102Renew every certificate automatically, and get an alert when one has under 14 days left.
Recommended
Turn off old encryption
APS-55Allow only TLS 1.2 and 1.3, with ECDHE key exchange and AEAD ciphers. Turn off TLS compression and 0-RTT for requests that change data.
Use only standard cryptography
APS-56Encrypt and sign only with current algorithms from a maintained library. Never write your own scheme, and never use ECB mode, MD5 or SHA-1 for security.
Keep encryption keys in a key service
APS-57Encrypt stored data with keys held in a key management service that never hands out the key itself. Rotate each key automatically, and keep the people who manage keys apart from the roles that use them.
Wrap data keys with a key-encryption key
APS-103Encrypt data with data keys, and store each data key only in wrapped form. A key-encryption key that never leaves the key service or HSM wraps it. Rotate the key-encryption key without decrypting the data.
Encrypt the most sensitive fields
APS-58Encrypt fields whose leak would cause serious harm, such as ID numbers or health data, in the app before they reach the database.
Prepare your encryption for quantum computers
APS-59List every use of public-key cryptography, and offer hybrid ML-KEM key exchange on every TLS connection you control. Make each algorithm a setting you can change.
Read this with
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/application-security/cryptography-and-keys">Agent Wranglers application security playbook</a>. In code you write, add a comment next to it with the same link.