Skip to main content
IoT
PSUT Engineering StudioPrincess Sumaya University for Technology
Student Edition
Cyber Defense StudioIoT Security and PrivacyExperimentsWorkspaces
IoT Security and Privacy / LC03
IoTPSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
ESSENTIAL LABORATORY · LC03 · IoT SECURITY AND PRIVACY
IoT Security and Privacy

SPECK — lightweight ARX block cipher

Trace modular addition, rotations, XOR, key expansion and inverse execution.

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

Scope and objectives

Scope of the experiment

Trace modular addition, rotations, XOR, key expansion and inverse execution.

The focus of this experiment is to trace SPECK addition, rotation and XOR on fixed-width words. Students then calculate modular addition and reverse round operations, and verify reference vectors and explain ARX word-size constraints. 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

  • Trace SPECK addition, rotation and XOR on fixed-width words.
  • Calculate modular addition and reverse round operations.
  • Verify reference vectors and explain ARX word-size constraints.
  • 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 trace SPECK addition, rotation and XOR on fixed-width words, calculate modular addition and reverse round operations, and verify reference vectors and explain ARX word-size constraints.

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 reference vectors and explain ARX word-size constraints. Separate predicted values from observations.

Prerequisite knowledge and related learning

Review the following catalogue prerequisites before starting. After completion, continue to tcpdump — packet capture and protocol filtering.

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.

Scientific concepts and engineering principles

Scientific architecture · LC03 · SPECK — lightweight ARX block cipher

Rotate, add modulo the word width, XOR the round key and combine with the rotated right word.
Rotate, add modulo the word width, XOR the round key and combine with the rotated right word.

Scientific foundations and analytical reasoning

SPECK32/64 uses ARX with ROR7, modular addition, key XOR and ROL2. Addition carries differ from XOR.

Before operating the equipment or executing the program, derive the expected outcome using the required theoretical work in Experiment. Use the diagram to identify the variables and system boundaries.

Scientific theory · ARX round and modular addition

SPECK32/64 uses 16-bit words, 22 rounds, right rotation by 7 and left rotation by 2. Each round computes x′=(ROR7(x)+y mod 2^16) XOR k and y′=ROL2(y) XOR x′. Addition introduces carries while XOR does not. Decryption reverses XOR, addition and rotations in the proper order.

Worked example and engineering interpretation

For x=0000, y=ffff and k=0000, x′=ffff and y′=0000. Separately, ffff+0002 modulo 2^16=0001, whereas ffff XOR 0002=fffd. Verify the reference vector and inverse with the workstations; the small educational configuration is not a modern production recommendation.

Engineering principles · additional worked teaching example

SPECK is an ARX family: modular addition, rotation and XOR. With 8-bit toy addition, 250+10 mod256=4; rotation differs from ordinary shift because discarded bits reenter. Parameters must match selected variant.

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.

How to investigate SPECK — lightweight ARX block cipher

Trace modular addition, rotations, XOR, key expansion and inverse execution.

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: Trace modular addition, rotations, XOR, key expansion and inverse execution.

  1. SPECK ARX structure — complete its numbered steps and record the requested evidence.
  2. Key expansion and reference vector — complete its numbered steps and record the requested evidence.
  3. Controlled comparison with SIMON — complete its numbered steps and record the requested evidence.
  4. Compare observations with the reference checks and submit the required evidence.

Reference check: a86842f2 22 rounds; every word remains 16 bits. 22 round keys. Decryption recovers original; distance varies.

Model boundary: The supplied lecture contrasts software-oriented SPECK with hardware-oriented SIMON. SPECK32/64 uses two 16-bit words, 22 rounds, right rotation by 7 and left rotation by 2. The round updates x=(ROR7(x)+y mod 2^16) XOR k, then y=ROL2(y) XOR x. Its key schedule uses the same arithmetic operations with a round counter. The detailed SPECK algorithm and reference vector supplement the supplied slides, which focus mainly on SIMON. This small variant is for learning, not production.

Independent task and submission evidence

2. Key expansion and reference vector — 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.

SPECK ARX family

SPECK uses addition, rotation and XOR (ARX). SPECK32/64 has two 16-bit data words, four master-key words and 22 rounds. Addition modulo 2^16 involves carry propagation; XOR does not.

Round and inverse

Compute x′=(ROR7(x)+y mod 2^16) XOR k; compute y′=ROL2(y) XOR x′. To invert, recover y=ROR2(y′ XOR x′) and x=ROL7((x′ XOR k)−y mod 2^16). All operations use fixed-width words.

Key schedule and comparison

The key schedule uses related ARX operations with a round counter. Trace the complete sequence before testing encryption and decryption. Compare operation counts and avalanche curves with SIMON under the same word width; do not infer platform performance solely from round counts.

Prerequisites: LC02

LC03 engineering diagram
Algorithm structure and data flow. Use the simulation to inspect the corresponding numerical transformations.

Block and key parameter families

Block width (bits)Supported key widths (bits)
3264
4872, 96
6496, 128
9696, 144
128128, 192, 256

Engineering diagrams

SPECK ARX datapath and carry-producing modular addition.
SPECK ARX datapath and carry-producing modular addition.

Worked engineering reasoning and boundary conditions

SPECK uses addition modulo 2^w, rotation and XOR (ARX). Inverse rounds reverse operations using subtraction and inverse rotations, with explicit word masking.

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.

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.

SPECK — lightweight ARX block cipher: operation pathwayWord additionF0 + 35 = 125 hexReduce25 hex mod 256XOR25 XOR 9A = BFInverseBF XOR 9A=25;subtract 35→F0Read the active operation, then inspect the accumulated state.

Step 1 of 4 · Word addition

Word addition

Word addition
F0 + 35 = 125 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 ARX?

Addition, rotation and XOR.

How many rounds in SPECK32/64?

22.

How does modular addition differ from XOR?

Carries propagate in addition.

What verifies the inverse?

Decryption recovers the plaintext.

What is the word width of SPECK32/64?

16 bits.

What are the SPECK32/64 data rotation constants?

Right 7 and left 2.

How is the new left word calculated?

ROR7(x) plus y modulo 2^16, XOR the round key.

How is the new right word calculated?

ROL2(y) XOR the new left word.

What is the published plaintext used in the lab?

6574694c.

What is the published reference ciphertext?

a86842f2 with key 1918111009080100.

What operation reverses modular addition?

Modular subtraction.

Why mask after modular addition?

To retain the fixed word width.

What does the key schedule produce?

One round key for every encryption round.

Why compare round counts separately from speed?

Different operations and implementations have different costs.

Evaluate (FFFF + 0002) mod 2¹⁶.

0001 hexadecimal. The carry beyond 16 bits is discarded.

Why does ARX modular addition create a different transformation than XOR?

Addition propagates carries between bit positions; XOR is independent per bit.

Given the output words, which input is recovered first in the SPECK inverse?

Recover y=ROR2(y′ XOR x′), then recover x using modular subtraction followed by ROL7.

Does a smaller round count prove greater performance on every device?

No. It depends on instruction costs, implementation, memory, architecture and measurement conditions.

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