Labs / Fix the Encryption Settings
CryptographyEasy

Fix the Encryption Settings

Bilal, a developer at ChaiBank, is building a payments service. It encrypts customer CNIC numbers and account details before saving them in the database. He has sent his draft encryption settings to the security team for review.

You are the reviewer. Read crypto-config.yaml and decide what should change in each setting.

Answer every question correctly to get the flag.

crypto-config.yaml

# payments-service: encryption settings (DRAFT, for review)
# Encrypts customer CNIC numbers and account details before
# they are saved in the database.

encryption:
  algorithm: AES-256
  mode: ECB
  nonce: "000000000000"         # fixed, same for every record
  key: "k3y-Ch@iB4nk-2026"      # written here so the app can start

key_source: hardcoded

# Reviewer: Sana (security team)
# Status: changes requested
1. Bilal says ECB is fine "because AES-256 is very strong". What do you ask him to use instead?
2. The nonce is fixed at "000000000000" for every record. What is the right fix?
3. The key "k3y-Ch@iB4nk-2026" was typed by Bilal. How should the real key be created?
4. The key is written inside the settings file, which is saved in the code repository. Where should it live?
5. After the switch to AES-GCM, one record fails to decrypt with an "authentication tag" error. What should the app do?

Submit the flag