Skip to main content
IoT
PSUT Engineering StudioPrincess Sumaya University for Technology
V21.6.5 · Student / connected
Cyber Defense StudioIoT Security and PrivacyExperimentsWorkspaces
Continue to CR09–CR20 — finite fields and AES →

V22.7 · Interactive algorithms, Python notebooks and WSL resources

Home / IoT Security and Privacy / EC08
IoTPSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
ESSENTIAL LABORATORY · EC08 · IoT SECURITY AND PRIVACY
IoT Security and Privacy

AES mathematics — Galois fields and block transformations

Build finite-field arithmetic tables and connect polynomial reduction and inversion to the AES S-box and state transformations.

Design experiment & verify evidence →
EC08 · Laboratory mentorAsk about the current experiment, its algorithms or Python notebook.
Ask Dr. MohammadAdaptive practice
EC08 · Academic orientation

Scope and objectives

Scope of the experiment

Build finite-field arithmetic tables and connect polynomial reduction and inversion to the AES S-box and state transformations.

The focus of this experiment is to represent AES state and compute binary-field products. Students then trace substitution, row movement, column mixing and key addition, and verify inverse recovery and distinguish each stage from full AES. The Concepts view explains the operation before the practical work; the Simulation view is used to examine reference and changed inputs, not to substitute for actual measurements.

Learning objectives

  • Represent AES state and compute binary-field products.
  • Trace substitution, row movement, column mixing and key addition.
  • Verify inverse recovery and distinguish each stage from full AES.
  • Record the relevant inputs, intermediate states and final verification result before changing the reference configuration.
  • Compare the reference calculation or decision with an independent implementation or authorized observation; state any discrepancy and the applicable model boundary.

Expected learning outcomes

On completion, students can represent AES state and compute binary-field products, trace substitution, row movement, column mixing and key addition, and verify inverse recovery and distinguish each stage from full AES.

Required deliverables

Submit the derivation or state trace for the named operation, the exact reference and changed configurations, the associated simulator or practical evidence, and a short validation statement addressing verify inverse recovery and distinguish each stage from full AES. Separate predicted values from observations.

Prerequisite knowledge and related learning

Review the foundational terminology in Concepts and confirm readiness using the existing setup instructions. After completion, continue to RSA — Keys, modular exponentiation and encryption.

Environment and experimental methodology

The included teaching workstation and the listed Python/Colab or WSL implementation. Historical and small-number constructions are instructional, not deployment recommendations.

Begin with a manual prediction, record the baseline, change one independent condition at a time, and compare the resulting trace or measurements with the original prediction. Record observations and uncertainty separately from reference values. Follow the experiment’s specific procedure, safety limits, and acceptance checks.

How to investigate AES mathematics — Galois fields and block transformations

Build finite-field arithmetic tables and connect polynomial reduction and inversion to the AES S-box and state transformations.

Analytical investigation means collecting an observation, identifying the mechanism, using a calculation or state trace to explain it, and checking your conclusion against evidence. Controlled comparison means changing one independent variable, holding the remaining relevant conditions constant, and measuring a dependent variable against a baseline. Experimental validation means comparing a predicted result to a reproducible observation or assertion; agreement inside a model does not certify hardware. Evidence-based reasoning connects a specific observation to a theoretical rule and states uncertainty, not merely an opinion. Performance characterization records a named metric and its units across conditions; sensitivity analysis changes one parameter across several values. A threat assessment links an asset, threat, consequence and evidence to a mitigation.

Experiment-specific guided practice

Objective: Build finite-field arithmetic tables and connect polynomial reduction and inversion to the AES S-box and state transformations.

  1. Complete the analytical preparation below before programming. Show the intermediate mathematical calculations.
  2. Prime and extension fields — complete its numbered steps and record the requested evidence.
  3. AES polynomial reduction and S-box — complete its numbered steps and record the requested evidence.
  4. AES state, ShiftRows and MixColumns — complete its numbered steps and record the requested evidence.

Reference check: DA×C5=DB in GF(256); AES S-box(05)=6B; AES known-answer ciphertext is 69c4e0d86a7b0430d8cdb78070b4c55a.

Model boundary: Fictional educational inputs. Browser algorithms and reference programs; no hardware or live-network measurements. Supplied starter notebooks may be incomplete; trace playback is recorded execution, not arbitrary Python running in browser.

Independent task and submission evidence

2. Prime and extension fields — complete its numbered steps and record the requested evidence. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.

Before execution write the independent variable and its levels, dependent observation with units where applicable, baseline, controlled variables, measurement method and expected result. For a state machine use state/event/output rather than inventing a numeric metric. Record failures and repeat the baseline. A weak conclusion is “it works”; a supported conclusion names the changed setting, observed value/state, corresponding rule and one limitation.

TrialChanged settingFixed settingsPredicted resultActual observation / unitsEvidence / uncertainty
A: baselineReferenceRecordPredictRecordRecord
B: one changeRecordSame as APredictRecordRecord
A: repeatRestoreSame as APredictRecordRecord

Completion: submit the filled table, relevant simulator screenshot or terminal/notebook output, reasoning with units/assumptions, and one limitation. Preserve the independent assessment questions; this guide does not fill their answers.

Scientific concepts and engineering principles

Scientific architecture · EC08 · AES mathematics — Galois fields and block transformations

AES state and round transformations — 128-bit block / four by four byte matrix; AddRoundKey / XOR key bytes; SubBytes / nonlinear lookup; ShiftRows / rotate by row index; MixColumns / GF(2^8), omitted final round
Scientific concept map: 16 plaintext bytes — State columns; AddRoundKey — XOR subkey; SubBytes + ShiftRows — Substitution / permutation; MixColumns — \(\mathrm{GF}(2^{8})\) multiplication; Final round — No MixColumns.

Prime and extension fields

GF(p) has p residues for prime p. GF(p^m) can be represented as polynomials of degree below m with coefficients in GF(p), reduced modulo a chosen irreducible degree-m polynomial. In GF(2^m), addition is XOR. Changing the irreducible polynomial changes the representation of multiplication and inverses.

AES byte arithmetic

AES uses GF(256) with modulus \(x^{8}\)+\(x^{4}\)+\(x^{3}\)+x+1 (0x11B). Multiplication by x is a left shift with conditional reduction by 0x1B. For nonzero bytes, calculate the multiplicative inverse; the AES S-box applies an affine transformation to that inverse, with zero mapped through the affine transform from zero.

State and rounds

The 16-byte AES state is arranged column-major. AES-128 starts with AddRoundKey, then executes ten rounds. SubBytes introduces nonlinearity; ShiftRows moves bytes across columns; MixColumns combines each column using a fixed matrix in GF(256); AddRoundKey XORs a 128-bit round key. Round ten omits MixColumns. The inverse transformations recover the plaintext.

Prerequisites: EC07 and earlier foundations as applicable.

EC08 engineering diagram
Algorithm structure and data flow. Use the simulation to inspect the corresponding numerical transformations.
AES round operations
The order of the four AES round transformations.

AES S-box (hexadecimal)

Row / column0123456789ABCDEF
0637C777BF26B6FC53001672BFED7AB76
1CA82C97DFA5947F0ADD4A2AF9CA472C0
2B7FD9326363FF7CC34A5E5F171D83115
304C723C31896059A071280E2EB27B275
409832C1A1B6E5AA0523BD6B329E32F84
553D100ED20FCB15B6ACBBE394A4C58CF
6D0EFAAFB434D338545F9027F503C9FA8
751A3408F929D38F5BCB6DA2110FFF3D2
8CD0C13EC5F974417C4A77E3D645D1973
960814FDC222A908846EEB814DE5E0BDB
AE0323A0A4906245CC2D3AC629195E479
BE7C8376D8DD54EA96C56F4EA657AAE08
CBA78252E1CA6B4C6E8DD741F4BBD8B8A
D703EB5664803F60E613557B986C11D9E
EE1F8981169D98E949B1E87E9CE5528DF
F8CA1890DBFE6426841992D0FB054BB16

AES inverse S-box (hexadecimal)

Row / column0123456789ABCDEF
052096AD53036A538BF40A39E81F3D7FB
17CE339829B2FFF87348E4344C4DEE9CB
2547B9432A6C2233DEE4C950B42FAC34E
3082EA16628D924B2765BA2496D8BD125
472F8F66486689816D4A45CCC5D65B692
56C704850FDEDB9DA5E154657A78D9D84
690D8AB008CBCD30AF7E45805B8B34506
7D02C1E8FCA3F0F02C1AFBD0301138A6B
83A9111414F67DCEA97F2CFCEF0B4E673
996AC7422E7AD3585E2F937E81C75DF6E
A47F11A711D29C5896FB7620EAA18BE1B
BFC563E4BC6D279209ADBC0FE78CD5AF4
C1FDDA8338807C731B11210592780EC5F
D60517FA919B54A0D2DE57A9F93C99CEF
EA0E03B4DAE2AF5B0C8EBBB3C83539961
F172B047EBA77D626E169146355210C7D

MixColumns matrix

Column 0Column 1Column 2Column 3
Row 002030101
Row 101020301
Row 201010203
Row 303010102

Engineering diagrams

AES round stages and state layout.
AES round stages and state layout.

Scientific foundations and worked examples

Prime-field and extension-field construction

GF(7) contains 0 through 6; operations reduce modulo 7, and all nonzero elements have inverses. GF(5) provides a smaller worked example: 2×3≡1, so 2 and 3 are inverses. GF(9) consists of a₁x+\(a_{0}\) with coefficients in GF(3); GF(16) consists of four binary coefficients. These extension fields are not integer arithmetic modulo 9 or 16. GF(4) with \(x^{2}\)+x+1 gives (x+1)²=x. GF(8) may use \(x^{3}\)+x+1 or \(x^{3}\)+\(x^{2}\)+1; addition is the same XOR table but multiplication depends on the modulus.

AES polynomial reduction and inversion

The byte DA represents \(x^{7}\)+\(x^{6}\)+\(x^{4}\)+\(x^{3}\)+x. AES reduces products by \(m(x)=x^8+x^4+x^3+x+1\) (0x11B). Thus \(x^{8}\)≡\(x^{4}\)+\(x^{3}\)+x+1 (0x1B) and \(x^{9}\)≡\(x^{5}\)+\(x^{4}\)+\(x^{2}\)+x (0x36). Multiply a byte by x using a left shift, then XOR 0x1B if the original top bit was set. Repeat for higher powers; XOR partial products for DA×C5. The extended polynomial Euclidean algorithm finds inverses: 05 has inverse 52 because 05·52=01 in GF(256). The AES S-box applies a bitwise affine transform to that inverse, yielding 6B for input 05.

State layout and round transformations

AES-128 maps 16 input bytes into a 4×4 column-major state. SubBytes applies the S-box independently; ShiftRows rotates row r left by r positions; MixColumns multiplies each column by the fixed matrix with first row [02,03,01,01] and cyclic shifts. AddRoundKey XORs the state with a round key. The initial AddRoundKey precedes ten rounds, and the tenth omits MixColumns. For the assigned state DA C5 followed by fourteen zero bytes, identify the nonzero positions before and after ShiftRows and calculate the four field products per affected column.

Engineering principles · additional worked teaching example

AES treats bytes as polynomials in \(\mathrm{GF}(2^{8})\) modulo 0x11B. xtime(0xC0) shifts left then reduces with 0x1B: 0x80 XOR 0x1B=0x9B. Multiplication by 3 equals xtime XOR original, giving 0x5B. XOR is addition, not decimal addition.

From theory to experiment

Predict the reference result before operating the workbench; check the actual intermediate state, units and constraints. The existing simulation, implementation and procedure below are distinct sources of evidence.

Worked engineering reasoning and boundary conditions

AES bytes are \(\mathrm{GF}(2^{8})\) elements, with polynomial reduction by 0x11B. For xtime(0x83), shift to 0x106 then XOR 0x11B =0x1D. The state is column-major.

Use the diagram to follow the calculation or state progression. Keep the teaching configuration separate from the independent exercise values; compare observations with the actual model and implementation.

Mathematical representation and interpretation

Binary polynomial arithmetic

a_i and b_i are binary coefficients. Multiplication is polynomial multiplication; reduction by the selected irreducible degree-n polynomial m gives a degree below n. It is not ordinary integer remainder arithmetic.

\[A(x)=\sum_{i=0}^{n-1}a_ix^i,\quad A\oplus B=\sum_{i=0}^{n-1}(a_i\oplus b_i)x^i,\quad A\otimes B=(A B)\bmod m(x)\]

For example, over GF(2), (x+1)+(x+1)=0 because each repeated coefficient cancels.

Concept animation · operation pathway

Explore the teaching example independently of the simulator. Each step reveals an operation, data relationship or calculated state. The Simulation view has separate editable inputs.

AES mathematics — Galois fields and block transformations: operation pathwayByte83 hexShift106 hexReduce106 XOR 11B = 1DField resultxtime(83)=1DRead the active operation, then inspect the accumulated state.

Step 1 of 4 · Byte

Byte

Byte
83 hex

Teaching example only; inspect live calculations or real practical evidence separately.

Interactive flashcards

Self-rated study progress is stored locally, not used for official grades.

Browse all explanations
What is AES block size?

128 bits.

Which operation mixes column bytes?

MixColumns over GF(256).

Which transformation is omitted in final round?

MixColumns.

What does AddRoundKey do?

XORs state with round key.

Why are AES bytes elements of GF(256)?

Each byte represents a degree-below-8 binary polynomial.

What polynomial defines the AES field?

x^8+x^4+x^3+x+1, represented by 0x11b.

What is AES field addition?

Bitwise XOR.

How is the AES S-box constructed?

Multiplicative inverse in GF(256), followed by an affine transform; zero maps through the affine transform.

What is S-box(0x53)?

0xed.

What is S-box(0x00)?

0x63.

What does ShiftRows do?

Cyclically shifts rows by their row index.

What does MixColumns do?

Multiplies each state column by a fixed matrix over GF(256).

How many rounds does AES-128 have?

10.

What operation is omitted in the final encryption round?

MixColumns.

Why use the Rijndael Inspector?

To inspect individual transformations and compare them with manual calculations.

Why is the AES field reduction polynomial 0x11B relevant when a byte is multiplied by 02?

The left shift may exceed eight bits. Reduction by \(x^{8}\)+\(x^{4}\)+\(x^{3}\)+x+1 keeps the result in \(\mathrm{GF}(2^{8})\).

Which transformation is absent in the last AES encryption round?

MixColumns. The final round contains SubBytes, ShiftRows and AddRoundKey.

A student applies AES S-box to input 05. What is the correct result?

6B hexadecimal. Invert the nonzero element in GF(256), apply the affine map, then verify the table entry.

How many round keys does AES-128 expand?

11 keys: the initial AddRoundKey and one for each of ten rounds.

Shared research workbenches · network designer & advanced studies
Concurrent-device simulation & Monte Carlo research
Distributed digital twin · topology, protocol & battery research