Safe cryptography
Use established constructions and manage the keys.
The idea
Use maintained platform libraries and approved protocols rather than designing ciphers. Passwords need a dedicated password-hashing scheme with a per-password salt and an appropriate cost. Encryption needs key management, rotation, authenticated integrity, and clear ownership. TLS protects a transport path, not all stored data.
Follow the flow
Make it concrete
This excerpt isolates the concept. Connect it to the booking API as you work through the exercise.
Need confidentiality + integrity? → authenticated encryption
Need password verification? → dedicated password hash
Need random token? → cryptographically secure generator
Keep keys outside source and logs.Decisions that matter
- Choose a control against a concrete risk and document its owner.
- Exercise negative cases in authorized test fixtures.
- Retain evidence at a specific revision and revisit it when the system changes.
Your turn
Why is hashing a password once with a fast general-purpose hash inadequate?
Reveal a worked answer
Fast hashes permit attackers to test guesses cheaply. Use the platform identity stack or a maintained password-hashing implementation with tunable cost and salts. Store algorithm and cost metadata so hashes can be upgraded.