Encryption changes readable sensitive data into encoded information that cannot be understood without the appropriate decryption capability. In a database, it is a safeguard for confidentiality: it helps keep sensitive values protected even if unauthorized access occurs. section 3.6 section 7.4
Do not store payment-method information in plain text. A database breach could expose every stored card number; encrypted information provides protection in that worst-case scenario. section 3.6
When designing storage for encrypted values:
- Identify sensitive information that should not be saved in plain text. section 3.6
- Choose an appropriate encryption method and encrypt the data. section 7.14
- Allocate enough space in each corresponding column for the encrypted result. section 7.14
Payment-method columns
A payment_method table can reserve larger fixed-length fields for encrypted card_number and expiry_date values. The important design check is that the encrypted values fit the columns, rather than assuming the original values’ sizes are sufficient. section 7.4 section 7.14
-- 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 a MySQL/MariaDB ALTER TABLE statement that changes payment-method fields to CHAR(45), illustrating storage allocation for encrypted values. section 7.4















