Data protection · AES

AES: Is a Copied Backup Still Safe?

Follow a research backup through AES byte transformations, then return to modes, authentication and key protection.

13 min read

MY saves research notes to an external drive for another laboratory. Someone copies the entire backup on the way. Possession of the file does not settle whether its contents have leaked. We also need to know how it was encrypted and where the secret key is kept.

This is a fictional teaching scenario. By the end, you will decide when the receiver may read a backup and when it must reject an apparently normal one. The plates provide clues; the article develops the reasoning. Field arithmetic and RTL details are available in optional notes.

  • Distinguish block size from key size and follow the four round operations.
  • Explain why AES needs a mode and why ciphertext still needs authentication.
  • Use real cryptographic results to distinguish authentication failure from replay of an authentic old record.

Try backup authentication →Trace each AES operation →

Does possession of the backup reveal its contents?

1/11 — The authorized reader uses the same secret key. Copying ciphertext and altering it are different events.
1/11 — The authorized reader uses the same secret key. Copying ciphertext and altering it are different events.

MY wants to protect the contents of the research notes. The file must remain copyable and transferable, and another laboratory must be able to recover it. Encryption transforms readable plaintext into ciphertext. Without the appropriate key, recovering the original should be computationally difficult. Ciphertext is still movable data; encryption does not stop someone stealing the drive.

AES is a symmetric block cipher. The authorized parties use the same secret key. Its algorithm and operating rules can be public. Protection must not depend on an attacker remaining unaware of the software's design. In the plate, the key does not travel with the copied file. That condition matters more than concealing the name AES. [1] [3]

For now, assume a secret key, a correct implementation and a suitable mode. If a text file beside the backup contains the key, copying both still enables decryption. Ciphertext may also reveal information such as file length. Confidentiality therefore needs a stated threat model and key-handling assumptions, rather than a judgment based on the file extension.

We must also ask whether the contents have changed. Someone can flip ciphertext bits without understanding them. The bare AES block operation does not supply authentication for an entire record. We will examine its transformations first, then return to the missing check. Keeping confidentiality and integrity separate makes the receiver's eventual decision easier to explain.

How large are blocks and keys?

2/11 — The four-by-four tray holds sixteen bytes. AES-128, AES-192 and AES-256 have different key lengths, not different block sizes.
2/11 — The four-by-four tray holds sixteen bytes. AES-128, AES-192 and AES-256 have different key lengths, not different block sizes.

The research backup is much larger than one AES input. AES processes a 128-bit block, which is 16 bytes. Each byte contains 8 bits. The four-by-four tray simply makes those sixteen bytes easier to inspect. A cell represents a byte, not a bit, and arranging the cells does not increase the cipher's capacity.

AES-128, AES-192 and AES-256 all process that same fixed-size block. Their suffixes specify key lengths of 128, 192 and 256 bits. A longer key does not enlarge the data tray. The key is the secret input that controls the transformation; the block contains the data being transformed. Their sizes describe different parts of the system. [1] [2]

For a long backup, the system must arrange repeated AES use and handle the mode's parameters. It must also deal with the final portion of the file. Those rules belong to the mode and file format. Modes differ, so a sixteen-byte block does not imply that every application needs the same padding rule, or needs padding at all.

We will temporarily take one complete block from the backup. This exposes the AES core without asking you to track the entire file's packaging at the same time. Later, we put the block operation back inside a mode. Correct single-block computation is a necessary starting point, but it does not complete the protection of a file.

Track positions before adding the key with XOR

3/11 — Input bytes fill the state by columns. The XOR example uses hexadecimal 57, 83 and d4.
3/11 — Input bytes fill the state by columns. The XOR example uses hexadecimal 57, 83 and d4.

AES places the sixteen input bytes in a four-by-four array called the state. It fills the first column before moving to the second. Input bytes 00, 11, 22 and 33 therefore run down the first column, rather than across the first row. Values in the plate are hexadecimal: two hex characters represent one byte.

This arrangement affects every later operation. Row-major loading still produces sixteen cells, but it changes which bytes become neighbors during ShiftRows and MixColumns. Engineers comparing a test vector must agree on byte order and matrix coordinates first. Otherwise, a display-order mismatch can look like a cryptographic error even when the underlying byte sequence is correct. [1] [4]

The initial AddRoundKey combines the state with the initial round key using bitwise XOR. XOR outputs 1 when two bits differ and 0 when they match. Across eight bits, the example is hexadecimal 57 XOR 83 = d4. Applying XOR with the same 83 again returns 57. That property makes this operation reversible.

Reversibility alone does not make a secure encryption scheme. Repeatedly XORing a file with a short secret pattern can leave exploitable relationships. AES adds round keys within a specified sequence of transformations; we have examined only one operation. SubBytes next changes byte values through a nonlinear rule, so the full calculation cannot be reduced to simple linear operations.

Why does a public S-box help?

4/11 — 53 always maps to ed; InvSubBytes reverses it. This is a public substitution rule, not a new random draw.
4/11 — 53 always maps to ed; InvSubBytes reverses it. This is a public substitution rule, not a new random draw.

SubBytes replaces each state byte independently. Input 53 produces ed, and another occurrence of 53 produces ed again. The mapping is called the S-box. A fixed lookup station is a useful picture, although real hardware can calculate the same mapping with logic instead of storing an entire table. The required result stays identical.

The substitution is nonlinear. Here, linearity concerns operations on bits and finite-field values; the shape of the illustrated dots cannot establish it. A design containing only linear operations would allow linear relationships among inputs, outputs and keys. SubBytes supplies nonlinearity, which must work together with diffusion and round-key addition in the complete AES construction. [1]

The S-box contains no secret key for this backup and generates no fresh entropy. It is a public, fixed, one-to-one mapping. Each output therefore has one inverse input. InvSubBytes maps ed back to 53. Public reversibility does not let an observer reverse the entire cipher without its key and the other required inverse operations.

Positions remain unchanged during this step; byte values change. Independent substitution alone does not spread one position's influence across many others. The next operation moves bytes into new columns so later mixing encounters different neighbors. The nonlinear sketch is only a teaching illustration. It is neither a measured S-box plot nor evidence that an implementation resists attacks.

Move positions to change the next set of neighbors

5/11 — a0 through a15 identify original positions. Rows rotate left by zero, one, two and three places without changing byte values.
5/11 — a0 through a15 identify original positions. Rows rotate left by zero, one, two and three places without changing byte values.

ShiftRows rotates each row to the left. The first row stays still; the remaining rows move by one, two and three places. Rotation means a byte leaving the left edge returns at the right edge of the same row. Nothing is discarded or replaced with zero. In the plate, a5 moves to the front of its row.

The labels a0 through a15 identify original positions. They are not a new set of AES test values. You can follow a5 to its destination while its actual byte value stays unchanged. This gives a checkable contrast with SubBytes: substitution kept positions and changed values, whereas ShiftRows rearranges those positions without substituting the values. [1]

The reason for moving bytes becomes clearer at the next operation. MixColumns combines four bytes in one column. If columns always interacted only with their original members, dependencies would remain restricted. ShiftRows brings sources from different columns together. Later mixing can then connect data that was previously separated. The two operations organize how influence travels through the state.

Reordering alone does not conceal byte values. Anyone who knows the rotation rule can undo it. AES does not treat ShiftRows as another secret key. It supplies routing within the public algorithm and works repeatedly with substitution, column mixing and round keys. In the interactive trace, stop at ShiftRows and verify that positions are the only thing it changes.

Mix within columns, then spread across rounds

6/11 — Column d4 bf 5d 30 becomes 04 66 81 e5. The small colored tiles illustrate dependencies, not state dimensions.
6/11 — Column d4 bf 5d 30 becomes 04 66 81 e5. The small colored tiles illustrate dependencies, not state dimensions.

MixColumns reads four bytes from one column and calculates four new bytes. The example takes hexadecimal d4, bf, 5d and 30 to 04, 66, 81 and e5. Every output combines all four inputs from that column. This single operation does not directly mix in bytes from other columns. Establishing that boundary prevents a common misunderstanding.

The rule multiplies a fixed matrix by the column vector, but addition uses XOR and multiplication takes place in the finite field GF(2⁸). Ordinary integer arithmetic gives different answers. A calculator result truncated to two hex digits is not a substitute. Beginners can first follow the four-input dependency; the optional engineering note explains the polynomial arithmetic. [1]

ShiftRows has already changed each column's members. MixColumns now combines those new neighbors. Later rounds spread dependencies more widely through the state. Colored lines represent influence, not a choice of one input or an irreversible blending of data. MixColumns has an inverse operation. The smaller colored tiles illustrate dependency spreading, rather than changing the state's four-by-four size.

Changing one input bit can produce changes in many output bits, but one observation cannot establish resistance to every attack. Diffusion is one property of the design. Correct implementation and leakage through power or timing need separate checks. In our backup story, these operations are building the block transformation; they have not yet authenticated the complete record.

Rounds have a specified order, and round keys have a source

7/11 — AES-128 begins with AddRoundKey, then runs ten rounds. The last omits MixColumns, not the round key.
7/11 — AES-128 begins with AddRoundKey, then runs ten rounds. The last omits MixColumns, not the round key.

AES-128 starts with one initial AddRoundKey and then performs ten rounds. Rounds one through nine apply SubBytes, ShiftRows, MixColumns and AddRoundKey in that order. Round ten keeps substitution, row shifting and key addition but omits MixColumns. Counting the initial operation as the first round can misalign round numbers, key indices and the final result.

Key Expansion derives the round keys from the original secret. Once that secret is fixed, the expansion and its results are deterministic. It does not request fresh physical randomness every round or create new entropy. K0 through K10 label the schedule entries used for eleven key additions. Protecting the original secret remains essential throughout the calculation. [1]

AES-192 and AES-256 use twelve and fourteen rounds, with differences in their key schedules too. Extending the AES-128 picture by two boxes does not implement AES-192. Removing rounds to reduce latency also produces something other than standard AES. Supported algorithm variants and implementation performance choices must be described separately, rather than silently changing the specified transformation.

The inverse calculation has rules as well. Standard InvCipher begins with the last round key, uses inverse operations and ends with the initial round key. Exact indices and intermediate states can be checked instead of guessed from a slogan. The next plate supplies a complete reproducible vector, so the block operation has an observable answer to match.

What does a known-answer test establish?

8/11 — All sixteen bytes of the key, plaintext and ciphertext must match. Colored tiles only illustrate the effect of a bit flip.
8/11 — All sixteen bytes of the key, plaintext and ciphertext must match. Colored tiles only illustrate the effect of a bit flip.

The plate uses a public AES-128 example. Its key is 000102030405060708090a0b0c0d0e0f, its plaintext is 00112233445566778899aabbccddeeff, and its ciphertext is 69c4e0d86a7b0430d8cdb78070b4c55a. Each string has thirty-two hexadecimal characters representing sixteen bytes. Line breaks only help layout; omitting the second half would turn the example into an invalid test vector.

A known-answer test supplies those inputs and requires a byte-for-byte matching output. If the answer differs, comparing intermediate states helps locate the first divergence. State ordering, round-key indices or an extra final MixColumns can cause failure. Decrypting back to the input is useful too, but testing only your own encryption against your own decryption can hide a shared mistake. [1] [4]

The preserved AES trace lab below calculates a teaching-model trace and compares its complete result independently with browser Web Crypto. These are functional paths, not an RTL simulation or a formal proof. You may also change one input bit and inspect the output. The colored tiles aid observation; they do not represent a measured security assessment.

Passing one vector establishes agreement for that test. Other keys, boundary inputs and failure paths still need coverage. It does not establish product certification or side-channel resistance. Once the AES core calculation is understood, we can return to the larger backup. The way an application uses many correct block operations still affects the protection it actually provides.

Lab 1: expand the AES trace experiment

MY ACADEMY · RTL LAB

Operate AES: inspect every state transformation

Enter one 128-bit block and key. Stop at Round 1 ShiftRows and compare both matrices. Then reach Round 10 and check that MixColumns is omitted.

Matrices use the column-major layout of FIPS 197. Position [row, column] maps to input byte 4×column + row. Each step shows values before and after an operation. These algorithm microsteps do not claim one RTL clock each.

Evidence scope: a browser functional teaching model. Independent comparison uses browser Web Crypto. No RTL simulation, synthesis, formal proof or side-channel testing is performed.

Independent comparison uses the first Web Crypto CBC block with IV=0: C0=AES_K(P0 XOR 0)=AES_K(P0). We compare only its first 16 bytes; a later padding block does not change the first. This checks single-block AES, rather than implementing a message mode in this lab.

QD

Before operation

After operation

Inspect blocks, schedule and round keys

Output handshake: valid / ready

At OUTPUT, the output remains stable. Set ready, then sample an edge to record acceptance. Changing ready alone does not accept data. This handshake is a separately defined teaching interface.

Transfer exercise: may RTL clear output_valid or overwrite the result before downstream is ready? State the hold rule in plain language: unless reset cancels the transaction, valid and data remain stable until a handshake. SVA syntax is an optional next exercise.

FIPS 197 §5.1 / §5.2

Repeated blocks can leave clues under the same key

9/11 — ECB maps repeated P blocks to repeated X blocks. Confidentiality from CBC or CTR does not replace authentication.
9/11 — ECB maps repeated P blocks to repeated X blocks. Confidentiality from CBC or CTR does not replace authentication.

Suppose the backup contains repeated sixteen-byte plaintext blocks, labeled P, P and Q. Encrypting each independently with the same key is the basic ECB arrangement. AES is deterministic, so the repeated P blocks produce repeated ciphertext blocks. We label the result X, X and Y. These letters identify relationships; they are not actual ciphertext values.

An observer may not immediately know what P contains, but can recognize equality. A fixed format or repeated structure may make that relationship useful. This is a problem in how the file uses the block cipher. Computing every AES invocation correctly does not remove the repetition that ECB exposes across the resulting ciphertext blocks. [2] [3]

A mode specifies how repeated cipher calls are arranged and how their parameters are handled. CBC and CTR provide confidentiality, but do not supply message integrity on their own. Ciphertext looking less patterned does not establish that attackers cannot alter it. Arbitrarily combining encryption with a hash is also not a substitute for a correctly designed authenticated construction.

We use AES-GCM because it lets us revisit both questions from the opening: whether an observer can recover contents without the key, and whether a received record passes authentication. Choosing the mode also brings nonce requirements and usage limits. The name of a standard algorithm has practical meaning only when its use matches the threat being addressed.

Authenticate with AES-GCM before releasing plaintext

10/11 — AAD is public but authenticated. Nonces must not repeat under one key. The plate's short labels are illustrative; the lab uses full parameters.
10/11 — AAD is public but authenticated. Nonces must not repeat under one key. The plate's short labels are illustrative; the lab uses full parameters.

AES-GCM provides authenticated encryption with associated data, usually abbreviated AEAD. It produces ciphertext and an authentication tag. The receiver supplies the key, nonce and matching associated data for authenticated decryption. The result is plaintext or failure. An application must wait for successful authentication before using the contents, rather than acting on data that has not yet been accepted.

Associated data, or AAD, stays readable but participates in authentication. A backup identifier can bind the encrypted contents to a record. To detect relocation, the receiver must supply the identifier it expects. Trusting an identifier copied from the file itself does not establish the correct destination. AEAD checks the supplied context; the system must decide what that context should be. [3] [5]

A nonce can be public, but must remain unique under a given key. Reuse breaks GCM's required conditions, can expose plaintext relationships and undermines authentication. It does not imply immediate recovery of the AES key. This lab uses a new ephemeral key on reset and an increasing 96-bit nonce. It is a single-page example, not durable multi-device nonce management.

Create a normal record, then alter ciphertext, AAD or the tag, or select the wrong key. The lab calls actual Web Crypto authenticated decryption; its results are not scripted traffic lights. These demonstrations fail without releasing plaintext. Authentication provides probabilistic forgery protection, rather than a mathematical promise that every possible changed record or wrong key is incapable of a collision.

Lab: authenticate a backup and replay an old version

Start with Seal and check. Select an alteration and observe real authenticated decryption. Version 5 can pass authentication but still fails trusted floor 8.

Only fixed fictional research data is used. Do not enter real secrets. Reset creates a new ephemeral AES-128 key; nonces increase under that key. This is not production key storage or power-loss recovery.

Preparing an ephemeral key…

nonce (96 bits)
—
Ciphertext (hex)
—
tag (128 bits)
—
AAD used by the receiver
—
  1. Authentication: not run
  2. Version policy: not run
  3. Plaintext: not released
—

After replaying version 5, set the floor to 0. The tag remains valid, but acceptance changes. Freshness comes from external policy; nonce uniqueness does not by itself stop replay.

All cryptographic operations stay on this page. This example does not export the key or transmit records. A non-exportable key does not resist malicious code controlling this page. No certification, hardware measurement or side-channel test is performed.

After authentication, check whether the record is fresh enough

11/11 — An authentic version 5 can pass authentication but fall below trusted floor 8. A floor rejects old versions; it does not prove global latestness.
11/11 — An authentic version 5 can pass authentication but fall below trusted floor 8. A floor rejects old versions; it does not prove global latestness.

Return to the copied backup. If the secret key remains protected and the mode and implementation are correct, possessing ciphertext should not make its contents easy to recover. The receiver authenticates with the correct key and expected context. A record that fails verification must not reach the research application. Confidentiality and integrity have distinct jobs in that decision.

An attacker may instead return an older, legitimately produced backup. Its version 5 ciphertext, nonce, AAD and tag remain unchanged, so authentication can succeed. Accepting it after the research process reaches version 8 could undo later results. The illustrated external trusted floor rejects version 5. That is an additional policy; GCM does not automatically know the record's chronological place. [3] [6]

The version must be authenticated, and the trusted floor must not roll back with the file. A floor states the minimum acceptable progress, not global latestness. If it remains at 8, it may not reject version 8 replacing version 9. Requirements may need a monotonic counter, trusted service or transaction consistency. Each choice needs an explicit design and recovery strategy.

Key generation, storage and use need protection too. Separating the key from the backup is a starting point; runtime bugs or side channels can still expose it. PQC key establishment and signatures address other jobs, rather than replacing AES content encryption. For a shared sensor archive, ask who may create records, how nonce allocation is coordinated and which trusted progress the receiver retains.

WORK IT BY HAND

Work it by hand: follow one block through AES round 1

AES works like a conveyor belt with four stations. SubBytes swaps values. ShiftRows moves bytes to new positions. MixColumns makes the bytes of one column affect each other. AddRoundKey brings in the key. One pass through all four stations is one round. AES-128 runs 10 rounds.

Below, we follow one block through round 1 with the public test vector in FIPS 197 Appendix C.1. You can check every number against the standard. The top-left byte stays highlighted the whole way. Follow it: 00 → 00 → 63 → 63 → 5f → 89.

Four stations stand along a conveyor belt. A 4×4 grid of data passes through value swapping, position shifting, mixing and key adding in turn.

1One block, one key

The plaintext has 16 bytes. The key also has 16 bytes. AES fills the 16 bytes into a 4×4 state matrix column by column. Bytes 1–4 go into column 1, bytes 5–8 into column 2, and so on.

Plaintext 00112233 44556677 8899aabb ccddeeff
Key 00010203 04050607 08090a0b 0c0d0e0f

004488cc
115599dd
2266aaee
3377bbff

Plaintext state

0004080c
0105090d
02060a0e
03070b0f

Key K0

The block is always 128 bits (16 bytes). AES-256 also uses a 128-bit block. The 256 is the key length.

2Initial AddRoundKey: the key enters first

Before any other operation, XOR the state with K0 byte by byte. The XOR rule is simple: two equal bits give 0, two different bits give 1.

11 ⊕ 01 = 10
0001 0001 ⊕ 0000 0001 = 0001 0000

004488cc
115599dd
2266aaee
3377bbff

Plaintext

0004080c
0105090d
02060a0e
03070b0f

K0

004080c0
105090d0
2060a0e0
3070b0f0

Input to round 1

The key takes part from the very first step. Each of the 16 bytes is computed on its own; they do not affect each other yet.

3SubBytes: swap each value with a table

Each byte is looked up in a fixed 16×16 table called the S-box. The high 4 bits pick the row. The low 4 bits pick the column. The cell where they meet is the new value.

50 → row 5、column 0 → 53
00 → row 0、column 0 → 63

004080c0
105090d0
2060a0e0
3070b0f0

Before SubBytes

6309cdba
ca536070
b7d0e0e1
0451e78c

After SubBytes

The S-box is the only nonlinear step in AES. The other three steps can be written as XORs and moves. Without the S-box, all of AES would collapse into a set of linear equations that an attacker could solve.

4ShiftRows: move bytes, keep values

Row 1 stays. Rows 2, 3 and 4 rotate left by 1, 2 and 3 positions. A byte that leaves on the left comes back on the right. For example, row 2 changes from ca 53 60 70 to 53 60 70 ca.

6309cdba
ca536070
b7d0e0e1
0451e78c

Before ShiftRows

6309cdba
536070ca
e0e1b7d0
8c0451e7

After ShiftRows

No value changes; only positions do. The 4 bytes that shared a column are now spread over 4 different columns.

5MixColumns: the four bytes of a column affect each other

Each column of 4 bytes is multiplied by a fixed matrix to give 4 new bytes. Take column 1, 63 53 e0 8c. The output is 5f 72 64 15.

02030101
01020301
01010203
03010102

Fixed matrix

63
53
e0
8c

Column 1

5f
72
64
15

New column 1

The first output byte uses matrix row 1, 02 03 01 01:

02·63 ⊕ 03·53 ⊕ 01·e0 ⊕ 01·8c
= c6 ⊕ f5 ⊕ e0 ⊕ 8c
= 5f (c6 ⊕ f5 = 33,33 ⊕ e0 = d3,d3 ⊕ 8c = 5f)

The “·” here is not ordinary multiplication. It is multiplication in GF(2⁸). You do not need the theory, only three rules:

  • ×01: no change.
  • ×02: shift left by 1 bit. If the leftmost bit was 1, also XOR with 1b.
  • ×03: compute ×02, then XOR with the original byte.
ProductBit by bitResult
02·630110 0011 → shift 1100 0110 (leftmost bit was 0, no XOR)c6
03·5302·53:0101 0011 → 1010 0110 = a6;a6 ⊕ 53 = 1111 0101f5
02·e01110 0000 → shift 1100 0000 → ⊕ 0001 1011 → 1101 1011db

Why 1b? The 1 pushed out on the left stands for x⁸. AES defines x⁸ = x⁴ + x³ + x + 1. As bits, that is 0001 1011 = 1b, so we add it back in.

Do this for all four columns to get the full MixColumns result:

6309cdba
536070ca
e0e1b7d0
8c0451e7

Before MixColumns

5f57f71d
72f5beb9
64bc3bf9
1592291a

After MixColumns

Every output byte uses all 4 bytes of its column. Change 1 input byte and all 4 outputs of that column change.

6Key expansion: where K1 comes from

Round 1 needs a new round key, K1. The 4 columns of K0 are called w0–w3. The 4 columns of K1 are w4–w7. Only the first word of each round key goes through a special function called g.

OperationWhat it doesResult
w3Last column of K00c0d0e0f
RotWordRotate the 4 bytes left by 10d0e0f0c
SubWordLook up each byte in the S-boxd7ab76fe
⊕ RconXOR the first byte with 01g(w3) = d6ab76fe

w4 = w0 ⊕ g(w3) = 00010203 ⊕ d6ab76fe = d6aa74fd
w5 = w4 ⊕ w1 = d2af72fa
w6 = w5 ⊕ w2 = daa678f1
w7 = w6 ⊕ w3 = d6ab76fe

Rcon changes every round: 01 02 04 08 10 20 40 80 1b 36. Each is the previous one ×02. Doubling 80 overflows, so the next value is 1b. That is the same rule as in step 5.

0004080c
0105090d
02060a0e
03070b0f

K0(w0~w3)

d6d2dad6
aaafa6ab
74727876
fdfaf1fe

K1(w4~w7)

Each round key is derived from the one before it. Rcon differs each round, so the 10 round keys never repeat the same pattern.

7AddRoundKey, then 9 more rounds

XOR the MixColumns result with K1 byte by byte. That is the output of round 1. The top-left byte: 5f ⊕ d6 = 89.

5f57f71d
72f5beb9
64bc3bf9
1592291a

After MixColumns

d6d2dad6
aaafa6ab
74727876
fdfaf1fe

K1

89852dcb
d85a1812
10ce438f
e868d8e4

Round 1 output

Rounds 2–9 repeat the same four stations, each with its own round key. Round 10 skips MixColumns. Here is the output of every round, read column by column:

RoundOutput
189d810e8 855ace68 2d1843d8 cb128fe4
24915598f 55e5d7a0 daca94fa 1f0a63f7
3fa636a28 25b339c9 40668a31 57244d17
424724023 6966b3fa 6ed27532 88425b6c
5c81677bc 9b7ac93b 25027992 b0261996
6c62fe109 f75eedc3 cc79395d 84f9cf5d
7d1876c0f 79c4300a b45594ad d66ff41f
8fde3bad2 05e5d0d7 3547964e f1fe37f1
9bd6e7c3d f2b5779e 0b61216e 8b10b689
10 (no MixColumns)69c4e0d8 6a7b0430 d8cdb780 70b4c55a

The ciphertext is 69c4e0d86a7b0430d8cdb78070b4c55a, exactly as in FIPS 197 Appendix C.1. Getting one block right only shows that the AES building block is correct. Whether a system is secure still depends on the mode of operation, the nonce and how the key is protected.

Engineering notes

Field arithmetic: check the first MixColumns output byte

The first row uses coefficients 02, 03, 01 and 01, so its result is (02·d4) XOR (03·bf) XOR 5d XOR 30. AES uses polynomial x⁸+x⁴+x³+x+1: 02·d4=b3 and 03·bf=da. Thus b3 XOR da XOR 5d XOR 30=04. The matrix is on the left of the column vector. Addition has no integer carry, and 03·bf is not ordinary multiplication by three. See FIPS 197 §§5.1.3 and 5.3.3 for the full matrices.

From a functional model to RTL: a step is not one clock

The trace shows algorithm operations, not one clock per click. Iterative and pipelined implementations differ in latency, throughput and area; round keys must stay aligned with data. Standard InvCipher ends with the initial round-0 key. Equivalent inverse implementations may rearrange internal work, but schedules cannot be mixed without verification. Real hardware also needs simulation, reset and failure-state checks, interface checks and key clearing. This page performs none of those hardware validations.

GCM nonces, tags and public context

This lab uses 96-bit nonces and 128-bit tags. The plate's #001 and short hexadecimal tag are illustrative, not complete parameters or known-answer values. The normal path increments a nonce under one ephemeral key; reset creates a new key. An in-memory counter is not durable product allocation. AAD also needs unambiguous encoding. The lab uses fixed short strings, while multiple tabs, devices and restored snapshots require a production design.

The separate jobs of AES, PQC and implementation defense

AES provides symmetric data encryption. Among PQC standards, ML-KEM establishes a shared secret, while ML-DSA and SLH-DSA provide signatures. They are not interchangeable file-encryption modes. Protocols also arrange derivation and identity authentication. Timing, cache behavior, power leakage and faults can expose secrets or disrupt execution even with the right algorithm. Defenses depend on the threat model, and vector tests do not establish attack resistance. This page explains the roles without estimating quantum attack costs.

Glossary

Block / state
AES's fixed 128-bit input and its four-by-four arrangement of bytes during computation.
Round key
Schedule data derived for a specified key-addition step, not an independent source of entropy.
Mode of operation
Rules for combining block-cipher calls and their parameters. Modes provide different services.
AAD / tag
AAD is unencrypted but authenticated context. The tag supports authentication of the record.
Nonce / freshness
GCM requires nonce uniqueness under a key. Freshness asks whether a record meets progress policy; the two are not interchangeable.

Learning check

1. With AES-256, how large is one data block?
2. Which operation moves byte positions without substituting their values?
3. The ciphertext is unchanged, but the receiver uses a different backup ID as AAD. What should happen?
4. An authentic version 5 has a valid tag, while the trusted floor is 8. What is the decision?
5. Two sensors now share a GCM key. Which additional arrangement is essential?

Where to continue

Primary sources

Sources checked 2026-10-17. The research backup, versions 5/8 and short illustrative hex are teaching material; plate eight contains a complete public vector. Standards and test results do not establish product certification.

  1. NIST FIPS 197-upd1 (2023): Advanced Encryption StandardState ordering (§3.4), round operations (§5.1), key expansion (§5.2), inverse computation (§5.3) and the Appendix B mixing example.
  2. NIST SP 800-38A: Confidentiality ModesECB and the scope of confidentiality modes; confidentiality alone does not provide authentication.
  3. NIST SP 800-38D: GCM and GMACAuthenticated encryption/decryption (§7), IV uniqueness (§8), reuse risks (Appendix A) and additional replay protection (Appendix D).
  4. FIPS 197 (2001), Appendix C.1: AES-128 exampleHistorical source of the 001122… / 000102… vector only. The current specification is the 2023 update above.
  5. W3C Web Cryptography: AES-GCM operationsBrowser authenticated encryption/decryption and failure semantics. The lab uses the platform implementation, not a homemade mode.
  6. NIST Post-Quantum Cryptography StandardsKey establishment with ML-KEM and signatures with ML-DSA/SLH-DSA, cited only to distinguish their roles.

#AES #AEAD #KeyManagement #HardwareSecurity