AES is a symmetric block cipher: the same secret key and algorithm encrypt and decrypt data. It protects sensitive values that must later be recovered, such as saved credit-card details. section 7.4
AES comes in three key-length variants:
- AES-128 uses a 128-bit key. section 7.4
- AES-192 uses a 192-bit key. section 7.4
- AES-256 uses a 256-bit key; longer keys increase security and computational requirements. section 7.4
Encrypting saved payment details
A payment_method table may store reusable card_number and expiry_date values. Instead of keeping them as plain text, encrypt card_number with AES-256 before storing it. AES-256 processes 16-byte blocks; an initialization vector can provide an additional nonsecret 16-byte input. Because encrypted data is binary, encode it as an ASCII string such as Base64. section 7.4
-- comment: works for MySQL and MariaDB -- comment: consult ChatGPT on adaptations -- comment: for other RDBMS ALTER TABLE payment_method MODIFY COLUMN card_number CHAR(45), MODIFY COLUMN expiry_date CHAR(45);
Shows database columns resized to hold encrypted card_number and expiry_date values. section 7.4

