IoTPSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
CRYPTOGRAPHY ENGINEERING · CR03 · DES
IoT Security and Privacy
DES · permutations and complete round trace
DES consumes 64-bit blocks; PC-1 removes eight parity bits from the supplied 64-bit key.
CR03 · Laboratory mentorAsk about the current operation and its intermediate values.
CR03 · Academic orientation
Scope and objectives
Scope of the experiment
DES uses 64-bit blocks, a supplied 64-bit key with eight parity bits, and sixteen Feistel rounds. IP and IP⁻¹ are public fixed permutations. Expansion duplicates boundary bits, allowing a 48-bit subkey to interact with a 32-bit half.
The focus of this experiment is to trace DES initial permutation, expansion, subkey mixing and S-box substitution. Students then calculate the first-round P permutation and Feistel state, and verify the complete historical cipher against a known-answer vector. 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 DES initial permutation, expansion, subkey mixing and S-box substitution.
Calculate the first-round P permutation and Feistel state.
Verify the complete historical cipher against a known-answer vector.
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 DES initial permutation, expansion, subkey mixing and S-box substitution, calculate the first-round P permutation and Feistel state, and verify the complete historical cipher against a known-answer vector.
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 complete historical cipher against a known-answer vector. 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 DES · S-box row and column.
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
CR03 · DES · permutations and complete round trace
DES consumes 64-bit blocks; PC-1 removes eight parity bits from the supplied 64-bit key. IP rearranges bits; E expands 32 to 48 bits; XOR with K, eight S-boxes compress to 32 bits; P permutes; 16 Feistel rounds, swap and IP inverse finish encryption. DES is historical only.
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
DES consumes 64-bit blocks; PC-1 removes eight parity bits from the supplied 64-bit key. IP rearranges bits; E expands 32 to 48 bits; XOR with K, eight S-boxes compress to 32 bits; P permutes; 16 Feistel rounds, swap and IP inverse finish encryption. DES is historical only.
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.
DES round architecture
1 · Principles and purpose
DES uses 64-bit blocks, a supplied 64-bit key with eight parity bits, and sixteen Feistel rounds. IP and IP⁻¹ are public fixed permutations. Expansion duplicates boundary bits, allowing a 48-bit subkey to interact with a 32-bit half.
2 · Mathematical and algorithmic foundations
IP(P)=L0||R0; B=E(R)⊕K (48 bits); split B into eight six-bit groups, apply S1…S8, concatenate 32 output bits and permute with P. R′=L⊕P(S(B)); L′=R. Output IP⁻¹(R16||L16).
For standard plaintext 0123456789ABCDEF, IP yields CC00CCFFF0AAF0AA. Under key 133457799BBCDFF1, E(R0)=7A15557A1555, K1=1B02EFFC7072, XOR=6117BA866527. S outputs 5C82B597 and P gives 234AA9BB; R1=EF4A6544. DES is historical only.
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
DES substitution and round processing
A six-bit input selects one of four rows using its outer bits and one of sixteen columns using its inner bits. S_j is the selected DES substitution table; v is a four-bit result.
Input 011011 selects row 1 and column 13; use the selected table to read the output.
Concept animation · DES round transformations
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 34 · IP
Teaching example only; inspect live calculations or real practical evidence separately.
IP
state
CC00CCFFF0AAF0AA
Round 1
K
1B02EFFC7072
expanded
7A15557A1555
mixed
6117BA866527
sbox
5C82B597
P
234AA9BB
state
F0AAF0AAEF4A6544
Round 2
K
79AED9DBC9E5
expanded
75EA5430AA09
mixed
0C448DEB63EC
sbox
F8D03AAE
P
3CAB87A3
state
EF4A6544CC017709
Round 3
K
55FC8A42CF99
expanded
E58002BAE853
mixed
B07C88F827CA
sbox
2710E16F
P
4D166EB0
state
CC017709A25C0BF4
Round 4
K
72ADD6DB351D
expanded
5042F8057FA9
mixed
22EF2EDE4AB4
sbox
21ED9F3A
P
BB23774C
state
A25C0BF477220045
Round 5
K
7CEC07EB53A8
expanded
BAE90400020A
mixed
C60503EB51A2
sbox
50C831EB
P
2813ADC3
state
772200458A4FA637
Round 6
K
63A53E507B2F
expanded
C5425FD0C1AF
mixed
A6E76180BA80
sbox
41F34C3D
P
9E45CD2C
state
8A4FA637E967CD69
Round 7
K
EC84B7F618BC
expanded
F52B0FE5AB53
mixed
19AFB813B3EF
sbox
107540AD
P
8C051C27
state
E967CD69064ABA10
Round 8
K
F78A3AC13BFB
expanded
00C2555F40A0
mixed
F7486F9E7B5B
sbox
6C187CAE
P
3C0E86F9
state
064ABA10D5694B90
Round 9
K
E0DBEBEDE781
expanded
6AAB52A57CA1
mixed
8A70B9489B20
sbox
110C5777
P
22367C6A
state
D5694B90247CC67A
Round 10
K
B1F347BA464F
expanded
1083F960C3F4
mixed
A170BEDA85BB
sbox
DA045275
P
62BC9C22
state
247CC67AB7D5D7B2
Round 11
K
215FD3DED386
expanded
5AFEABEAFDA5
mixed
7BA178342E23
sbox
7305D101
P
E104FA02
state
B7D5D7B2C5783C78
Round 12
K
7571F59467E9
expanded
60ABF01F83F1
mixed
15DA058BE418
sbox
7B8B2635
P
C268CFEA
state
C5783C7875BD1858
Round 13
K
97C5D1FABA41
expanded
3ABDFA8F02F0
mixed
AD782B75B8B1
sbox
9AD18B4F
P
DDBB2922
state
75BD185818C3155A
Round 14
K
5F43B7F2E73A
expanded
0F16068AAAF4
mixed
5055B1784DCE
sbox
64799AF1
P
B7318E55
state
18C3155AC28C960D
Round 15
K
BF918D3D3F0A
expanded
E054594AC05B
mixed
5FC5D477FF51
sbox
B2E88D3C
P
5B81276E
state
C28C960D43423234
Round 16
K
CB3D8B0E17F5
expanded
206A041A41A8
mixed
EB578F14565D
sbox
A7832429
P
C8C04F98
state
434232340A4CD995
Decrypt IP
state
0A4CD99543423234
Decrypt Round 1
K
CB3D8B0E17F5
expanded
206A041A41A8
mixed
EB578F14565D
sbox
A7832429
P
C8C04F98
state
43423234C28C960D
Decrypt Round 2
K
BF918D3D3F0A
expanded
E054594AC05B
mixed
5FC5D477FF51
sbox
B2E88D3C
P
5B81276E
state
C28C960D18C3155A
Decrypt Round 3
K
5F43B7F2E73A
expanded
0F16068AAAF4
mixed
5055B1784DCE
sbox
64799AF1
P
B7318E55
state
18C3155A75BD1858
Decrypt Round 4
K
97C5D1FABA41
expanded
3ABDFA8F02F0
mixed
AD782B75B8B1
sbox
9AD18B4F
P
DDBB2922
state
75BD1858C5783C78
Decrypt Round 5
K
7571F59467E9
expanded
60ABF01F83F1
mixed
15DA058BE418
sbox
7B8B2635
P
C268CFEA
state
C5783C78B7D5D7B2
Decrypt Round 6
K
215FD3DED386
expanded
5AFEABEAFDA5
mixed
7BA178342E23
sbox
7305D101
P
E104FA02
state
B7D5D7B2247CC67A
Decrypt Round 7
K
B1F347BA464F
expanded
1083F960C3F4
mixed
A170BEDA85BB
sbox
DA045275
P
62BC9C22
state
247CC67AD5694B90
Decrypt Round 8
K
E0DBEBEDE781
expanded
6AAB52A57CA1
mixed
8A70B9489B20
sbox
110C5777
P
22367C6A
state
D5694B90064ABA10
Decrypt Round 9
K
F78A3AC13BFB
expanded
00C2555F40A0
mixed
F7486F9E7B5B
sbox
6C187CAE
P
3C0E86F9
state
064ABA10E967CD69
Decrypt Round 10
K
EC84B7F618BC
expanded
F52B0FE5AB53
mixed
19AFB813B3EF
sbox
107540AD
P
8C051C27
state
E967CD698A4FA637
Decrypt Round 11
K
63A53E507B2F
expanded
C5425FD0C1AF
mixed
A6E76180BA80
sbox
41F34C3D
P
9E45CD2C
state
8A4FA63777220045
Decrypt Round 12
K
7CEC07EB53A8
expanded
BAE90400020A
mixed
C60503EB51A2
sbox
50C831EB
P
2813ADC3
state
77220045A25C0BF4
Decrypt Round 13
K
72ADD6DB351D
expanded
5042F8057FA9
mixed
22EF2EDE4AB4
sbox
21ED9F3A
P
BB23774C
state
A25C0BF4CC017709
Decrypt Round 14
K
55FC8A42CF99
expanded
E58002BAE853
mixed
B07C88F827CA
sbox
2710E16F
P
4D166EB0
state
CC017709EF4A6544
Decrypt Round 15
K
79AED9DBC9E5
expanded
75EA5430AA09
mixed
0C448DEB63EC
sbox
F8D03AAE
P
3CAB87A3
state
EF4A6544F0AAF0AA
Decrypt Round 16
K
1B02EFFC7072
expanded
7A15557A1555
mixed
6117BA866527
sbox
5C82B597
P
234AA9BB
state
F0AAF0AACC00CCFF
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.
DES consumes 64-bit blocks; PC-1 removes eight parity bits from the supplied 64-bit key. IP rearranges bits; E expands 32 to 48 bits; XOR with K, eight S-boxes compress to 32 bits; P permutes; 16 Feistel rounds, swap and IP inverse finish encryption. DES is historical only.
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
Use plaintext 0123456789ABCDEF and key 133457799BBCDFF1. Use the supplied DES permutation tables and trace the first round: IP, L0, R0, expansion, key XOR, S1 input/output and P. Explain the role of the final swap.
Application and derivation — IP(P)=L0 Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
02 · Reverse reasoning
Reverse reasoning · Independent work
In a DES round, L'=0x000000AA, R'=0x000000F0, F(L',K)=0x0000000F. Recover L,R and explain why this does not invert an S-box.
Reverse reasoning — 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 · CR03-01
For the separate teaching-test configuration plaintext: 1123456789ABCDEF; key: 133457799BBCDFF1, predict recovered 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 · CR03-02
A teaching trace for DES · permutations and complete round trace contains step: Round 1; K: 1B02EFFC7072; expanded: 7A15557A1555; mixed: 6117BA866527; sbox: 5C82B597. Explain the role of state (recorded value F0AAF0AAEF4A6544) 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 · CR03-03
The first teaching trace contains step: IP; state: CC00CCFFF0AAF0AA; the last contains step: Recovered; plaintext: 0123456789ABCDEF. 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 · CR03-04
Plan a comparison of plaintext: 0123456789ABCDEF; key: 133457799BBCDFF1 with plaintext: 1123456789ABCDEF; key: 133457799BBCDFF1. Record the dependent value recovered, 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.
Use 0123456789ABCDEF and 133457799BBCDFF1. Record IP, then round 1 E, K, E XOR K, all eight S-box outputs, P and new halves. Compare round 16 and final permutation.
Save the trace and compare it with the reference output.
Change plaintext to 0123456789ABCDEE; keep the supplied key fixed. Compare round 1 and final ciphertext. Restore default and inspect decryption trace.
Record the conditions held fixed: 64-bit key
Collect IP, round 1 and 16 internal fields, final ciphertext and recovered input. Compare the first differing intermediate step and explain the relationship.
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.
Run the supplied default values and record the first and final state.
Predict the effect before changing anything. Change one hexadecimal plaintext digit. First verified alternate: {"plaintext": "1123456789ABCDEF"}.
Keep 64-bit key.
Measure IP, E, XOR, S, P, L||R and ciphertext; reverse-key recovery.
Restore the baseline and repeat with another valid input. Locate the first differing calculation.
Submit a comparison table, a trace JSON or screenshots of relevant steps, and a short conclusion with an explicit limitation.
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 CR03
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 CR03/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.
What is the first intermediate state in the baseline?
step: IP; state: CC00CCFFF0AAF0AA
What check must you reproduce before varying the inputs?
IP=CC00CCFFF0AAF0AA; first subkey=1B02EFFC7072; default ciphertext=85E813540F0AB405.
Which observations belong in your experimental record?
IP, round 1 and 16 internal fields, final ciphertext and recovered input.
06 · Knowledge assessment
Formative check
Which experimental design best isolates the effect of the specified input?
Responses are for instructor review; no grading key is provided here.
Independent assessment
Use plaintext 02468ACEECA86420 and key 0F1571C947D9E859. Calculate IP, round-1 E(R) and XOR independently; compare the final result and recovered plaintext. Use an additional valid trial, a calculation or a counterexample to support your reasoning. Submit evidence from both runtimes and explain what the experiment does not establish.
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.