liveBook · Manning

AES

As explained in Grokking Relational Database Design

AES is a symmetric block-cipher standard that encrypts data using key sizes of 128, 192, or 256 bits.

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

How Grokking Relational Database Design covers it

How deep it goes
Explains shared-key encryption, variants, block size, initialization vectors, and binary encoding, but stops short of implementation code.
Examples
Uses saved card_number and expiry_date values in a payment_method table as the concrete encryption example.
What it assumes
Assumes database-column context and introduces symmetric encryption through its shared-key behavior.
What you can do after
Apply AES-256 to replace plain-text storage for sensitive, reusable database values.
How it connects
Connects AES with symmetric encryption, initialization vectors, Base64 encoding, and database schema design.

Also explained in

Compare how 2 books explain AES →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Relational Database Design. The section links point to the parts of the book it draws on.