IoTPSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
CRYPTOGRAPHY ENGINEERING · CR10 · FINITE FIELDS
IoT Security and Privacy
\(\mathrm{GF}(2^{3})\) · multiplication, reduction and inverse
\(m(x)=x^3+x+1\) (0xB).
CR10 · Laboratory mentorAsk about the current operation and its intermediate values.
CR10 · Academic orientation
Scope and objectives
Scope of the experiment
An irreducible polynomial has no nontrivial factors over its coefficient field. Reducing products by a degree-three irreducible polynomial yields representatives of degree below three and ensures nonzero elements have inverses.
The focus of this experiment is to multiply polynomials over GF(2) and reduce modulo the cubic polynomial. Students then derive inverses and division in \(\mathrm{GF}(2^{3})\) for nonzero elements, and verify the multiplicative identity and reject division by zero. 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
Multiply polynomials over GF(2) and reduce modulo the cubic polynomial.
Derive inverses and division in \(\mathrm{GF}(2^{3})\) for nonzero elements.
Verify the multiplicative identity and reject division by zero.
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 multiply polynomials over GF(2) and reduce modulo the cubic polynomial, derive inverses and division in \(\mathrm{GF}(2^{3})\) for nonzero elements, and verify the multiplicative identity and reject division by zero.
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 the multiplicative identity and reject division by zero. Separate predicted values from observations.
Prerequisite knowledge and related learning
Use the curriculum sequence and the Concepts section for prerequisite terminology. After completion, continue to \(\mathrm{GF}(2^{5})\) · polynomial long division.
Environment and experimental methodology
A standard browser and the experiment-specific Python implementation or Colab notebook. Where the practical uses a protocol model, model results are distinguished from actual local cryptographic operations.
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.
01 · Experiment overview
CR10 · \(\mathrm{GF}(2^{3})\) · multiplication, reduction and inverse
In \(\mathrm{GF}(2^{3})\), all elements are polynomials of degree below 3. Multiply without carries, then repeatedly cancel the leading term with a shifted modulus. For division by a nonzero b, find \(b^{-1}\) and multiply.
Before starting
Environment: standard computer, browser and Python/WSL.
Simulation: Editable JavaScript calculation
Technical scope: Classroom computation on a standard computer. Educational cipher code is not a production security implementation.
Complete the six stages in order. Use the same experiment inputs when comparing manual, browser and Python results.
02 · Concepts and mathematical foundations
In \(\mathrm{GF}(2^{3})\), all elements are polynomials of degree below 3. Multiply without carries, then repeatedly cancel the leading term with a shifted modulus. For division by a nonzero b, find \(b^{-1}\) and multiply.
Learning objectives
Calculate the named operation, inspect its intermediate values, reproduce the result in Python, and explain one controlled change. Prerequisites: binary/hexadecimal arithmetic; complete preceding labs in the same topic where applicable.
Before starting
Environment: standard computer, browser and Python/WSL.
Simulation: Editable JavaScript calculation
Technical scope: Classroom computation on a standard computer. Educational cipher code is not a production security implementation.
Mathematical model
\(m(x)=x^3+x+1\); a/b = a·\(b^{-1}\) mod m(x)
Worked calculation
0x3·0x5 has raw product 0xF; XOR with 0xB yields 0x4. The inverse of 0x5 is 0x2.
Common error and troubleshooting
Zero has no multiplicative inverse; it is not legitimate to divide by zero.
Check the input format and trace the first step at which your manual result differs. Compare with Python before drawing a conclusion.
Multiplication and field inverses
1 · Principles and purpose
An irreducible polynomial has no nontrivial factors over its coefficient field. Reducing products by a degree-three irreducible polynomial yields representatives of degree below three and ensures nonzero elements have inverses.
2 · Mathematical and algorithmic foundations
Multiply polynomial terms using XOR for repeated powers; reduce by XORing a shifted modulus until degree falls below 3. Here m=\(x^{3}\)+x+1 (0xB). For division multiply by \(b^{-1}\), defined by b·\(b^{-1}\)=1.
3 · Worked teaching example
\(x^{2}\)·x=\(x^{3}\)≡x+1 (mod m), or 0x4·0x2=0x3. Check x·(\(x^{2}\)+1)=\(x^{3}\)+x≡1. Ordinary integer multiplication is not carryless multiplication.
Captured earlier local execution. Randomized values and timing can differ; compare the invariant.
4 · Verification and experimental interpretation
Step through the following visualization and compare the named operation with the corresponding computed state. Check the mathematical invariant, inverse operation or protocol acceptance condition. Change one input at a time; distinguish a measured output from a prediction.
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.
For example, over GF(2), (x+1)+(x+1)=0 because each repeated coefficient cancels.
Concept animation · Polynomial multiplication and reduction
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.
Step 1 of 4 · Polynomial operands
Polynomial operands
A = x+1 (011), B = x²+1 (101); m=x³+x+1 (1011).
Carryless multiply
A·B = (A<<2) XOR A = 1111, not ordinary integer multiplication.
Reduce modulo m(x)
Cancel x³ by XOR with 1011; remainder 0100.
Verify field result
Remainder x² has degree below 3, so product in GF(2³) is 100.
Teaching example only; inspect live calculations or real practical evidence separately.
Shared research workbenches · network designer & advanced studiesConcurrent-device simulation & Monte Carlo research
Verified baseline reference — use the live workstation below to explore steps and compare inputs.
Edit the fields and choose Recompute. Use step controls to inspect real calculated states. Hexadecimal byte fields are written without 0x; numeric fields accept decimal or 0x notation.
Use the baseline inputs shown above. Predict a result, advance one operation at a time, inspect the intermediate state, then change only the parameter specified in the Experiments view. Export the trace and compare it with your manual derivation.
In \(\mathrm{GF}(2^{3})\), all elements are polynomials of degree below 3. Multiply without carries, then repeatedly cancel the leading term with a shifted modulus. For division by a nonzero b, find \(b^{-1}\) and multiply. \(m(x)=x^3+x+1\); a/b = a·\(b^{-1}\) mod m(x). 0x3·0x5 has raw product 0xF; XOR with 0xB yields 0x4. The inverse of 0x5 is 0x2. Zero has no multiplicative inverse; it is not legitimate to divide by zero.
Predict the baseline result before revealing the calculated state. A controlled comparison changes the named input while keeping the other conditions fixed. Record an observed value separately from an expected value.
Part A · Independent theoretical exercises
Complete each question before running the simulator or Python. Show calculations or protocol traces. The teaching example is a method, not a substitute for the assigned values.
01 · Application and derivation
Application and derivation · Independent work
Using \(m(x)=x^3+x+1\), multiply \(x^{2}\)+1 by x+1. Show the unreduced polynomial, each XOR reduction and the final field element. Find the inverse of x+1 by checking candidate products.
Application and derivation — Multiply polynomial terms using XOR for repeated powers; reduce by XORing a shifted modulus until degree falls below 3. Here m=\(x^{3}\)+x+1 (0xB). For division multiply by \(b^{-1}\), defined by b·\(b^{-1}\)=1. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
02 · Field arithmetic
Field arithmetic · Independent work
Using \(m(x)=x^3+x+1\), calculate 0x04 times 0x04 and verify the reduction.
Field arithmetic — Review the defining equations and compare the input restrictions and state transitions in Concepts. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
Required evidence: state the expected invariant or acceptance condition; record hand-derived results, compare with the simulator or Python trace, and explain the first discrepancy. Do not report a predicted value as a measurement.
Expanded independent theoretical exercise bank
Progress from calculation and interpretation to diagnosis and controlled engineering design. Complete the questions without opening the simulation first; show intermediate steps.
Intermediate · Alternate configuration
Independent theoretical exercise · CR10-01
For the separate teaching-test configuration a: 0x3; b: 0x1, predict sum using the relevant operation or decision rule. Show intermediate work and state whether this is a deterministic result.
Intermediate · Interpret a computation state
Independent theoretical exercise · CR10-02
A teaching trace for \(\mathrm{GF}(2^{3})\) · multiplication, reduction and inverse contains step: Addition; hex: 06; polynomial: x^2+x. Explain the role of polynomial (recorded value x^2+x) and identify the rule or input that determines it. Distinguish an intermediate state from the final result.
Advanced · Identify a terminal invariant
Independent theoretical exercise · CR10-03
The first teaching trace contains step: Operands; A: x+1; B: x^2+1; modulus: x^3+x+1; the last contains step: Result; raw: 0F; quotient: 01; remainder: 04; inverse: 02; division: 06; times02: 06; times03: 05. Identify one distinction between the initial operation and completion. What additional condition must hold to use the result?
Challenging · Controlled algorithm verification
Independent theoretical exercise · CR10-04
Plan a comparison of a: 0x3; b: 0x5 with a: 0x3; b: 0x1. Record the dependent value sum, identify the changed factor(s), and describe the verification and failure criterion without claiming a real security measurement.
Part B · Guided simulation and practical procedure
Before starting — tools and setup
Standard computer; extract the WSL toolkit into a new directory. For the browser activity, use the integrated workstation. Editable browser calculation
Install Python dependencies only if required by the selected toolkit README. Use its requirements file and virtual environment instructions.
Use the exact baseline input below and write a prediction.
Select the baseline configuration below. Predict the relevant operation using the theory; execute the workstation and record the first and final state. Reproduce the same input with Python.
Save the trace and compare it with the reference output.
Experimental inputs
Experimental reference · json
{"a":"0x3","b":"0x5"}
Verified baseline reference (check after predicting)
Experimental reference · json
{"sum":6,"product":4,"inverse":2,"division":6}
Compare your baseline with the verified reference output below; for runtime-dependent results, compare invariants and report actual measurements instead of expecting identical timing or randomly generated values.
Evidence to record
raw product, quotient, reductions, inverse and division (if defined)
Change a,b to 7,3 for the division example; then b=0. Hold modulus 0xB.
Record the conditions held fixed: modulus 0xB
Collect raw product, quotient, reductions, inverse and division (if defined) Compare the first differing intermediate step and explain the relationship.
Trial
Input configuration
Prediction
Observed
Verification
1
{"a":"0x3","b":"0x5"}
2
{"a":"0x3","b":"0x1"}
Use the table as a recording template; enter your own measured values in the field below or reproduce it in your report.
Part E/F · Independent Python verification and deliverables
Download the notebook or toolkit and run the default example.
Reproduce at least one changed input; compare the intermediate values with the browser where supported.
Complete the independent assessment below without copying the worked baseline. Explain discrepancies and distinguish mathematical results from security claims.
Additional investigation instructions
A controlled comparison changes one independent input while holding other inputs fixed, then measures its effect on the dependent output. A baseline is the unmodified run. Evidence-based reasoning means citing the actual observed values, not merely asserting that an algorithm is secure.
Predict the result using the mathematical model before operating the simulator.
Run a=0x3,b=0x5. Record each multiply term and long division step. Keep a fixed; set b=0x1 then 0x0. Verify nonzero inverses by multiplying back. Separately test 0x7/0x3.
Export the calculated trace. Reproduce the same inputs in Python and compare every relevant intermediate value.
Submit a table with one row per trial: inputs, fixed conditions, intermediate values, measured result, verification equation and interpretation. State why small classroom calculations do not establish production security.
Trial
Changed input
Fixed conditions
Prediction
Measured value
Reason / limitation
Baseline
None
Default
Student prediction
Record trace
Explain
Trial 1
Specified change
Unchanged inputs
Student prediction
Record trace
Explain
Part C · Python, Google Colab and WSL
The standalone implementation uses the same synthetic baseline and calculations as the browser. In Colab, download the notebook, open Colab and upload it using File → Upload notebook. Run all cells in order.
Use Ubuntu or Kali WSL, not PowerShell. Download the toolkit above to your computer. If Python, venv or unzip is missing, install these prerequisites once (requires administrator permission and network access).
In WSL, enter the actual downloaded ZIP path when prompted (for example, a file under /mnt/c/Users/…/Downloads). Extract to a new, dedicated directory. If this directory already exists from a previous extraction, use the existing verified toolkit or choose a clean directory rather than overwriting it.
Step 1 · Extract · bash
read -r -p "Full path to PSUT_V22_9_9_Cryptography_WSL.zip: " ZIP
DEST="$HOME/psut-crypto-v22.9.9"
if [ -f "$ZIP" ] && [ ! -e "$DEST" ]; then
mkdir "$DEST" && unzip "$ZIP" -d "$DEST"
else
echo "Check ZIP path and use a fresh destination."
fi
Create the isolated environment in the extracted toolkit root, activate it, then enter this experiment’s actual folder. Install only its declared dependencies. A comment-only requirements file requires no third-party packages.
Step 2 · Activate and install · bash
cd ~/psut-crypto-v22.9.9
python3 -m venv .venv
source .venv/bin/activate
cd CR10
ls
python -m pip install -r requirements.txt
Execute the default run and save the genuine program output. Then run the supplied regression test and the baseline fixture through the explicit input interface.
To change inputs, copy example-input.json, edit the copy in a text editor and run the command below. The original fixture is preserved.
Step 4 · Change an input · bash
cp example-input.json my-input.json
# Edit my-input.json with your preferred editor.
python lab.py --params my-input.json
These scripts terminate normally. Use Ctrl+C to stop a long-running calculation if needed. When finished, leave the isolated virtual environment; no global service cleanup is required for these local examples.
Step 5 · Finish · bash
deactivate
Declared dependencies: # Standard library only for core experiment
Expected terminal output — captured local execution
This excerpt contains the actual first trace step and final result from python lab.py, followed by the actual regression test output. Full stdout is in CR10/verified-output.txt inside the toolkit. Timing, random signatures, keys, certificate fields and implementation-dependent sizes can vary; compare the invariant and record your own observations.
Check the output JSON and the test exit status. An assertion error means the expected invariant was not met. If Python reports a missing module, activate the environment and install the experiment’s requirements file; if a file is missing, check pwd and ls.
Recall before revealing. Review and mastery ratings remain on this device.
Browse all explanationsWhy reduce by 0xB?
It encodes \(x^{3}\)+x+1, the selected irreducible polynomial.
What is the raw product of 0x3 and 0x5?
0xF before reduction.
Which element has no inverse?
Zero.
How do you verify an inverse?
Multiply the pair and reduce; result must be 1.
Explain the baseline worked calculation.
0x3·0x5 has raw product 0xF; XOR with 0xB yields 0x4. The inverse of 0x5 is 0x2.
What is the common misconception?
Zero has no multiplicative inverse; it is not legitimate to divide by zero.
06 · Knowledge assessment
Formative check
When is field division a/b undefined?
Responses are for instructor review; no grading key is provided here.
Independent assessment
Find the inverse of 0x6 and verify the product using polynomial reduction.
Submit handwritten or typed calculations, a browser trace and matching Python output. Explain the operation and any invalid condition. Evaluation: mathematics 40%, reproducibility 30%, interpretation 20%, limitations 10%.
Part F · Engineering evidence record
Record the baseline, prediction, changed input, observed result, discrepancy and limitation. Save locally or export with the displayed result. This is not an official submission.