Security Engineering

In an authorized test, testers recover plaintext tokens from an API that decrypts AES-CBC, verifies a MAC afterward, and returns different errors for bad padding and bad MAC. What is the BEST remediation?

Show the answer

Correct answerB. Adopt authenticated encryption (AES-GCM) with uniform errors

AWhy not this: A longer key does not matter; the leak comes from error behavior, not key strength.

BWhy this is right: AEAD checks integrity before decryption and uniform errors leave no oracle to query.

CWhy not this: Rate limiting only slows queries; the oracle still leaks plaintext information.

DWhy not this: Frequent rotation limits how long a key is exposed, but each key still allows oracle attacks.

The distinct padding and MAC errors form a padding oracle, a flaw in the implementation rather than in AES. Authenticated encryption verifies integrity before any decryption output is used, and uniform errors remove the oracle. A longer key, rate limiting or rotation leave the oracle in place.