Skip to main content
IoT
PSUT Engineering StudioPrincess Sumaya University for Technology
Student Edition
Cyber Defense StudioIoT Security and PrivacyExperimentsWorkspaces
Home / IoT Security and Privacy / Cryptography Engineering
IoTPSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
CRYPTOGRAPHY ENGINEERING · CR64 · HASHING
IoT Security and Privacy

SHA-3 sponge: rate and capacity

SHA3-256 sponge and Keccak-f.

CR64 · Laboratory mentorAsk about the current operation and its intermediate values.
CR64 · Academic orientation

Scope and objectives

Scope of the experiment

Keccak-f[1600] state has 25 lanes of 64 bits. A sponge absorbs blocks into the rate portion, permutes the whole state, then squeezes output from the rate. Capacity stays outside direct input/output.

The focus of this experiment is to distinguish Keccak rate, capacity, absorption and squeezing. Students then trace a state permutation and output extraction, and verify SHA-3 digest length and distinguish the sponge from SHA-512. 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

  • Distinguish Keccak rate, capacity, absorption and squeezing.
  • Trace a state permutation and output extraction.
  • Verify SHA-3 digest length and distinguish the sponge from SHA-512.
  • 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 distinguish Keccak rate, capacity, absorption and squeezing, trace a state permutation and output extraction, and verify SHA-3 digest length and distinguish the sponge from SHA-512.

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 SHA-3 digest length and distinguish the sponge from SHA-512. Separate predicted values from observations.

Prerequisite knowledge and related learning

Review the following catalogue prerequisites before starting. After completion, continue to File and firmware integrity.

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

CR64 · SHA-3 sponge: rate and capacity

SHA3-256 uses a 1600-bit state of 25 lanes, each 64 bits. Its rate is 1088 bits (136 bytes) and capacity 512 bits. Domain padding uses suffix 06 and final 80 bit, with both combined when sharing the last byte. Absorption XORs input into the rate, then applies 24 rounds of theta, rho, pi, chi and iota. Squeezing reads output bytes from rate lanes in little-endian order.

Learning objectives

SHA3-256 sponge and Keccak-f. Predict a result, inspect intermediate states, verify the invariant and explain the specified boundary case.

Prerequisites

Before starting

Environment: standard computer, browser and Python/WSL.

Simulation: live bounded classroom calculations in the browser and Python.

Technical scope: Block-count and padding model plus library digest; no Keccak permutation trace.

Complete the six stages in order. Use the same experiment inputs when comparing manual, browser and Python results.

02 · Concepts and mathematical foundations

SHA3-256 uses a 1600-bit state of 25 lanes, each 64 bits. Its rate is 1088 bits (136 bytes) and capacity 512 bits. Domain padding uses suffix 06 and final 80 bit, with both combined when sharing the last byte. Absorption XORs input into the rate, then applies 24 rounds of theta, rho, pi, chi and iota. Squeezing reads output bytes from rate lanes in little-endian order.

Learning objectives

SHA3-256 sponge and Keccak-f. Predict a result, inspect intermediate states, verify the invariant and explain the specified boundary case.

Prerequisites

Mathematical verification and controlled comparison

Substitute the output into its defining equation or check the protocol invariant. A controlled comparison changes one input while holding others fixed. Cite actual trace values and identify the limitations of the evidence.

Before starting

Environment: standard computer, browser and Python/WSL.

Simulation: live bounded classroom calculations in the browser and Python.

Technical scope: Block-count and padding model plus library digest; no Keccak permutation trace.

SHA-3 sponge

1 · Principles and purpose

Keccak-f[1600] state has 25 lanes of 64 bits. A sponge absorbs blocks into the rate portion, permutes the whole state, then squeezes output from the rate. Capacity stays outside direct input/output.

2 · Mathematical and algorithmic foundations

SHA3-256 uses rate 1088 and capacity 512; byte-aligned domain separator 0x06 and final padding bit 0x80. Each of 24 rounds applies θ,ρ,π,χ,ι: parity mixing, rotations, lane permutation, nonlinear mixing and constant injection.

\[b=r+c=1600,\quad c=2d,\quad r=1600-2d\]

3 · Worked teaching example

For an empty message, first rate byte becomes 06 and final rate byte 80 before the first permutation. Compare against hashlib.sha3_256; SHA-3 is not SHA-512's compression construction.

Verified default trace · 27 intermediate states

Given parameters (teaching example):

{
  "message": "abc"
}
StageComputed values
1{ "phase": "domain padding", "input_bytes": 3, "rate_bytes": 136, "capacity_bits": 512 }
2{ "phase": "absorb block", "index": 0, "block_bytes": 136, "prefix": "6162630600000000", "lanes": [ "0000000006636261", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "8000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000", "0000000000000000" ] }
3{ "phase": "Keccak-f round", "index": 0, "round": 0, "lanes": [ "0000040006636261", "3626100000000066", "00000731b1308000", "0000000006436260", "36261331b1308006", "0000000000000008", "6c4cfc6c4c2000c4", "1000000000000008", "6c4c3000000000cc", "1000cc6c4c200000", "000000000cc6c4c2", "0000000cc6c4c220", "0000000000000000", "0000000cca0606c2", "0000000000040020", "0066362f9d898400", "0000001000004000", "000000198d898400", "0066362610004000", "0000001000000000", "4362610000000006", "0000020000000000", "63626100198d8982", "2000020000000000", "00000000198d8984" ] }
4{ "phase": "Keccak-f round", "index": 0, "round": 1, "lanes": [ "b6b325adc633eec4", "d33adc52cef7f93a", "5e528c35d5193b13", "c0dd85d31cd4a57a", "e999a2f43a2c2398", "28a443eb0f40bc8b", "c9bcc34e00041aae", "87909d2348a64377", "85b37bb2516f6e28", "553030f0b5716a5f", "57891ecfbac639be", "8f1bed8e9eb3b5fe", "f65d81303afc1db4", "07ee7f4d95690570", "0283444033b3c245", "20646b0f972e619a", "6402d9788f313bc7", "8e7cec66172e6017", "531e1ff2a32f401f", "db1faf3a9bfc1cdb", "bc1fb24420d6aa27", "b228f4f473dc074f", "08b2babf4445dadf", "939cc5252aa816c8", "9622744f2c34e7ae" ] }
5{ "phase": "Keccak-f round", "index": 0, "round": 2, "lanes": [ "10fb57a1c5470a5b", "ad853c8f26f63ed9", "4031b99f75bea265", "6d2babeecd0c8c3d", "db085530a540dffa", "f8e22dbc9c2a05fd", "28d4cb9bb90fdf96", "56cd5c1d2494a473", "82bc4dd88e1ab1e1", "c9e4f809ca4dba38", "08fbe8f9c346eec8", "5eec36d198428b00", "a1ee90df0282224b", "7e6f6415f34078f1", "0525d8a8145330ac", "731953959c2285d4", "53809b91ccce6eb3", "4a9e2dc31eee8629", "824418521b8d6533", "bf1c6b19f905c609", "9670693356e1c253", "eee524fb8f498522", "6ebf3510e32e7f35", "a7c94aba39779f8e", "bc3e6565fe186162" ] }
6{ "phase": "Keccak-f round", "index": 0, "round": 3, "lanes": [ "5b60f45ed10e4bee", "2c37c8b29e8c4f73", "07e7b66e8ab73bd8", "8069ec499e32ef10", "1d55b3f8ee4800c6", "a0be5b06553c7093", "e6379f0883be6877", "8d03e311bba0dbaf", "4ff50c1fd02d5b1c", "48501d4592ca785d", "9c9b89225417518f", "4300c9197462e916", "034bd7a7f2002153", "7e3b424a68220a40", "9d22cb3de7e99ebf", "f8a1d37c27665fab", "7966c1c60bb8b2f4", "01163a41ac593154", "c1dd7ee8bd6b645f", "c41328d2f6f738f2", "11e1cabde4b6d635", "7594a4eb426e7684", "936073df2bec52b0", "b3685a7d459eded4", "703d7ad00f8a4de3" ] }
7{ "phase": "Keccak-f round", "index": 0, "round": 4, "lanes": [ "3d9874c4121c4efd", "a8abb9600dc7f113", "919db1268052fa78", "5943bcdc8ea4c6cd", "a0aa7c92629c5a49", "a1f397dbbe7ca7f1", "4ba7ae83a129748e", "ebaead43eaaffbf5", "036a1e09ad3e16a1", "f812d8a856de1a25", "2bd2db1e58703273", "bf05470bad761cb0", "31df49add63ef1e8", "08d1ec05dc92af10", "bc8a3eb0e29398b4", "a13bd794ce042838", "44017639e569b987", "c19018e36fbefbf0", "e6c544a7594eeb60", "3c1483d70eec80dd", "6524509dd4f96e0d", "43c6b84aac8ed56f", "652650c07c4160ac", "b8b4b7121ea7ca04", "aada3833497b50c1" ] }
8{ "phase": "Keccak-f round", "index": 0, "round": 5, "lanes": [ "e4f9e90c96ef83d6", "a1c16a2978b5c198", "9101ab98506dbf78", "3212bf5e28992153", "bdd3dd730d13104f", "e02d4bf7c1709eb0", "3782fb47da817f71", "553618a2ceed8cef", "1e57d467bb5cd0ab", "393d4292223ea46a", "29527a7478a51310", "cc92e6b4504c90bb", "45b511ab630e6766", "d82089169c452597", "67975182b106013f", "333621f7ae0d71bf", "5c04e0f61928799d", "5ead449fa9cf3258", "fe548a17d34aa1e9", "79f25ce865b39fb0", "a02a0d568e154ca2", "230404e08f115eaa", "54be0e3fe7168203", "3f16e9c13b861d3f", "b354127461ee7a4f" ] }
9{ "phase": "Keccak-f round", "index": 0, "round": 6, "lanes": [ "332e4e7b04174536", "8a54efcf3cd0e230", "392fe850500496df", "7b2b967ed1374e64", "d6a4d7b9a4e854d1", "42f06ed26c2b4c61", "137da54c085274f6", "5a76e9d953a208b8", "b8e65ab48e956a3d", "326982e889fdf9d0", "00e54448c070778d", "ea2226451c84fc36", "b8f5cec1ee261d8b", "f005c1d4bbd1a835", "02c5509537320158", "30a2fcf60f0e1932", "781dc8f0551b4100", "baacdce70f3220d4", "4a50c17a7525883f", "57aa39082facfd51", "f5a34ee8fcad19ff", "15833cbec19f5393", "0f972a82c8ee81a6", "27646ceaf1802870", "2ab4b2a19a60f052" ] }
10{ "phase": "Keccak-f round", "index": 0, "round": 7, "lanes": [ "1413d15f9a58b82b", "c4fdd2a7921ec134", "2f9932dec0af2e9b", "0183b5d8d06a4dfc", "2f1855fa0811075f", "8c09d244d2002bbd", "7085cd5394c2c548", "465dc5e266c924bd", "0505e2a50d8ba041", "041b5370db785030", "c79032447b5eeab7", "64ac5b232326275f", "81dc34913cd17dd2", "23b46e2ce22fed65", "c65ca802a18d4b33", "19950427ec010ad2", "acf1e6de4cbd920b", "834dc60e53987504", "0239b928e379e876", "ff3f05911c581b61", "b2984c710d48dd4e", "c9e17b1ab9fc8a06", "2d268a58270e50b0", "c611d13d3ecd18ad", "fb3e42619b14a0e0" ] }
11{ "phase": "Keccak-f round", "index": 0, "round": 8, "lanes": [ "97c40511eec66961", "fcbf50a0cb385f14", "c536e9d1203c7946", "82dcc93e3d329f5d", "d07ee7f2535eac4e", "0553a5005155c78d", "137d4bddd484e0bb", "02e34cf13a69c89b", "1707fb920910c6da", "29f286e7c2e83101", "7dbb495224278671", "494fde06216fec9c", "19d79fe13f66346e", "0aa4cef9b5b10ff6", "5efdf054b2e0a030", "7a67f175393d6ff6", "a3e7a09bbeeae1b4", "30e7a8b08c9c8d72", "f6ef03ba5f16baee", "53dadd0cf3fb2d0d", "b72952711539ff4d", "d6cc65cf573e2cde", "f47377667f45aa7d", "aeaca577a4868c71", "8e44d21c1d42007c" ] }
12{ "phase": "Keccak-f round", "index": 0, "round": 9, "lanes": [ "6066993fcc62e555", "515e54042c3b58f6", "3d5fd0284d6373c7", "09a75d5080c3704b", "169a824824ae9b4d", "a7c2e39ff2dc0749", "6c143cb71a388034", "14e612a815bddc4b", "619d1705d04f3591", "3d38a06f23aa3e1b", "c760a18907715cbd", "ef7c6b624a11e207", "8a1dcb1beb0bda05", "e4133b763907eb44", "39e3816117c52969", "2a10ed0742d83857", "a5d8f40f4e3b8667", "507998dc2ac7897a", "a4e7d74dc96f37dd", "d00ff7744eea32ae", "663a5f5d00526861", "07fab1101b62c406", "c55149feb7be21d1", "1ab6966d085eff05", "1f4bb69d264f5401" ] }
13{ "phase": "Keccak-f round", "index": 0, "round": 10, "lanes": [ "ff7afe2da7b4ea9d", "194cf5de0eca6bc2", "236d72efcf74f5bb", "5d030147bfc59e9d", "d51a1ecda3916c79", "a7a243c5a0501620", "00b759bcd6b8adc4", "d24e58b3746a0994", "bf9ed285e583c904", "323335deaed95b7b", "c211dd8e9a0f3847", "889c084b3192def2", "6366ef478ab50049", "8b56811acb83d679", "c134aad0ae756cdc", "47d8fda13deae237", "53e3e955a6d8ea89", "2e599d33b68d4a8b", "b64a617c3b80e24e", "86b7319308c6333f", "f867fd704fe7f3db", "cd70932329033dce", "7279a089a74bc120", "160d47967301587b", "9925a441c5fa4750" ] }
14{ "phase": "Keccak-f round", "index": 0, "round": 11, "lanes": [ "ed9e52eed7893220", "434ceb91a4a4939e", "75c58ff8f741ea71", "a6e0bbfb5c617e7c", "4427b9cc5daec301", "67bb83626dc3cd9b", "903a914ea43b1400", "26698b9de3a74a84", "da28946acf148124", "15d2b6daee571f07", "538691c2cbecba3f", "6d1ba46a75eee717", "3214e9bcac7d62a3", "d704861c0c6e449f", "ff66946d38333905", "012c57eea1229d18", "73ea6e7d5c06b7ba", "864dbcfabf17dae4", "d48430777b794856", "f6e95e8709c34cd0", "c59ed1156ef2d3ec", "d50032c357acef5b", "bd6e99b92a5bc6d4", "146590e63aabdf5f", "c33529da19f0391d" ] }
15{ "phase": "Keccak-f round", "index": 0, "round": 12, "lanes": [ "c7de86b8324651d4", "3e3fc391785ff41a", "4b79fba74b8497f3", "1098bbbc44b50234", "c34a2ff40ce4c08e", "0047508d51a4dabe", "0ad4d74ad0b14bf3", "c045ef95151a91cb", "2000c37187b39d29", "24e6e6137f3251a5", "44fd6c16428e4940", "4cd48b411d8a22b8", "96289722c0ff0075", "f59ba8abe644bea2", "cd96a13cf6c92b42", "98f179c978e943f9", "b8e2c873df3eb568", "57d7efc0fd622434", "4de0206615016485", "847ae194b6363b20", "6ec68667ad0227a1", "bf211e42979d28bd", "2f0005df34884f5c", "d0bc0fa6dd7dbdee", "f580850a9b3dfb83" ] }
16{ "phase": "Keccak-f round", "index": 0, "round": 13, "lanes": [ "cf64592128de0d95", "133caf54929c48f2", "6fa7694b486226ae", "3fc04c77e683de6a", "7c75458307ed417e", "803961a8dc8d28a5", "d3e7b0f83a056179", "022fee0188a3d35d", "791b094eb7f5b8b4", "36cee67123361696", "1f952a0441da9075", "41827d7ea99839c7", "3b811c0d564f9a7a", "839529b6019f0033", "a5d5aea9d98f027a", "4c57e3b5db8f98d2", "0b6a33ae4578b5f2", "5773db0a6d2891ed", "2cd76dedbb894c90", "7caaeb3426aabf05", "d1080b76de25594e", "4e4967997ac53e04", "7dcdb83997da80f9", "067ce669d8c33ff5", "0ba307ce10f15214" ] }
17{ "phase": "Keccak-f round", "index": 0, "round": 14, "lanes": [ "5ea1d44a9aaa12ba", "bc819a399bede0af", "ad4089848da43a6d", "41a9f842f56c15cb", "651e3af44a8ebad6", "21ce3f5e121b5b64", "59f509bee8d521eb", "7078bb76a5a4fe12", "668222f4411a84c0", "12fe8839f1002601", "4ffb0beef5088003", "078dbed45a18d98e", "1ff2f915433fda43", "2370e8d5eb4fbe08", "3c71155f58b37bea", "eae547ee2c05fb71", "bf9aed511a8dfa16", "87dd679140c011c5", "915cdb4b30e67ce1", "6a5034cc5c88a436", "7d60a40e873e3105", "551af9883ca7eb41", "3dbe94accffedcc1", "e72e48bb8cdb9cdb", "68dfa56d70fa15c7" ] }
18{ "phase": "Keccak-f round", "index": 0, "round": 15, "lanes": [ "2561d669cbfd175f", "54c328db6f932645", "e25fe700735dc055", "f9845f6100bf7b79", "48b0ef2c936b5d14", "f8ff30f7babfca67", "f2ba793cf7d32f53", "e0b87689229e06cc", "ab34df0da9df820b", "db325dc864df8c75", "1486502d5ad90af5", "1e203cc9a1b66b61", "5507b00402134959", "0a93ea3a807c549a", "84957f47f2cee731", "9b1477858718f4a9", "b08fe9c600238724", "4a30560e61131d47", "0ebe0460231d9df3", "5f0c333e06d147f6", "d9c37cca4869d762", "946204dd2699418d", "59dbe098b5c1548b", "2d659f24432552fa", "2d622fadac0d3afd" ] }
19{ "phase": "Keccak-f round", "index": 0, "round": 16, "lanes": [ "c17327d34ad21993", "c7699d1f878f7155", "f142a8f41294fc79", "337f6e79fbf20d7e", "ed55533b08293003", "b90f1ba22157c623", "e97d16a0c9dac81c", "24a48baf5f284238", "866b54c6ff26fd58", "a46390116f9097ee", "ae8736210bf8bf2a", "944cb7adc65cfc23", "14f24451171ad2f2", "638dc7a62825b283", "e7036551b213574e", "7a2cd79ae1275f0b", "a00f7e18d4de1a5a", "a21c008d24df9777", "a213b41e3f090096", "c0a395aa50436bd2", "6562a9c43fd47e42", "18daf77f3bbde0ed", "0fb4aea549ea967b", "6fe83e8a474bb63c", "467a1a6a31f066e7" ] }
20{ "phase": "Keccak-f round", "index": 0, "round": 17, "lanes": [ "f484e486f0efcd77", "646f0ba91f0ca9a2", "9c3b0b00dcb1e7d0", "85ec75b2f0bfe6c6", "a0559d0ecb53d39c", "c9c6a1bf59609746", "380837e67668c63a", "1ce2a30289555025", "181ef73ef30b47ee", "376ffcd954feb887", "6bc1fce28cf757ca", "3274401585455684", "e6ba0e4a311cd2ac", "ae00d8f1e05aafe8", "ba611467b0b90a53", "594fae3bcb30de67", "158421d96fc5ce1d", "034514db4e9a9a12", "fd7d477060784f6f", "0fe2cc64db9dea30", "ab428cb6730b4a26", "e4778b6f7bd0d407", "fe5073678da908cd", "46b8f68fe00b95d9", "64c54796a085e811" ] }
21{ "phase": "Keccak-f round", "index": 0, "round": 18, "lanes": [ "9dfb96545c836829", "8b0d1e80f5f5d444", "3c683149a8fdb140", "491c7477d3761e4f", "a4ae36c561b0bb33", "af73ecf12db6a5ac", "3b70de715b6b26d0", "5bcfd5c854cb9534", "16d151d4ee0ef32a", "de3bfc55261d9036", "ec8f273df2f0b260", "1368f22f10bad3a0", "37790700417157fa", "4819698285bd87ce", "6fd7c53db90d0a7b", "01b2c0f0bb0b3681", "d2d232ab8fc3222a", "d822ae5f3383d600", "0a1bf0ee88fce464", "5d1815c0fb5bd8ea", "441d22a2b86f1b4a", "7507cea567652cb1", "81f6e13fa5e42e75", "ad5b06f9fd1651d0", "c1508707a302eef0" ] }
22{ "phase": "Keccak-f round", "index": 0, "round": 19, "lanes": [ "dd73c60ed316443c", "2f7c0e64f9859858", "6693488740c17d4c", "d60d41cc38d0009e", "f2a912fb65ed096d", "5b5b53069d0a7e34", "93b0e74e85d5b6c7", "f0209fafcd4cc60b", "6fa64bea6a946324", "38a74f786f62b63f", "6125f311be0d27c8", "198bfc540380890f", "6de4520db1e61fff", "d9915227348b89fa", "0138c22f4c431a5f", "252ee81a894a7fd2", "ee9fb9c4fe0edf36", "34d69f09a64a627b", "9f39d5ac23c845ee", "a22655f0bb1f44d4", "a6587a6910080924", "40c3846182c45e6a", "a2381c408d15cfbc", "e8fd374b6a887d71", "faee27b42651c3ac" ] }
23{ "phase": "Keccak-f round", "index": 0, "round": 20, "lanes": [ "c8bf72508ea0b811", "eee0e7ca9efde4ae", "c1a5ea9620fd9737", "02aa3701017a8d21", "79213655a0980d57", "3acc5e90bcd498c9", "443ca4bbe8eaece1", "676a7a732fda49b6", "bddbcee2c9ea4760", "14fae801fa286bb9", "24e2bc25f05b622b", "3bb62e6270111a15", "25f143315403231d", "0f270b425219265d", "09cf34f999249217", "4cd4a06cf7ac081c", "6acd79b8f93a7584", "8cb319dae9892eba", "694b7d23f1a18a1e", "e6a3a47bfed84db0", "3590434017393347", "1032f84befc5d236", "b206f6610b9c18da", "f8b47b61cca9a9ad", "b72b43443f38de9b" ] }
24{ "phase": "Keccak-f round", "index": 0, "round": 21, "lanes": [ "624cf262ad2714ce", "352b8a1fba3d9483", "d8492c0b8a38b01f", "67090f114df17b1b", "042e7e7e2a4139cb", "ab607abd17c0c144", "f651399434622ba7", "b2ab4b969e6b7307", "5bf89756db14c43c", "97599b28aabae8d6", "6487d9f99feb3db6", "4b3fdf042c5886b3", "4f9750a4dbb1385e", "80b0031d2d394ff8", "d750d6fcfd039c9f", "2297f98f687802bd", "ff53479507beac2b", "a595d4c70ba07338", "8c6fb3b8c20e133a", "2006037cadf1dcad", "3a9abb677dc02b7c", "8a3dbf30d4522021", "e910b499de03442a", "1e100dd4c56973c8", "97e2c9667c4ae11e" ] }
25{ "phase": "Keccak-f round", "index": 0, "round": 22, "lanes": [ "4398e5f06685135d", "c5bf390099c90207", "6d4fef3618652a3d", "bed81aa723a14842", "26d4206724fa74a5", "106b6512cd67fff3", "8e00e58f8c0fa2a9", "e9986cb7c3786fef", "6e5cd302bb56a0f1", "210cffd6eadbfa35", "a600e6bd7e1194e6", "bf2576559c3bc025", "bcd3f5c75e0d0b56", "70d3f05f1fca68e1", "f329d9104030ec39", "c73c89517a3febc6", "850da5f46f4ab7d5", "1f1876803fffb4ab", "056c99ce5b77c3c1", "ffd14303d7c7ba4e", "76429cd3318b0b76", "95da8d8fae5c3dbb", "490ba44850ef0a80", "d630da462678de6b", "b0444bcbc9d10553" ] }
26{ "phase": "Keccak-f round", "index": 0, "round": 23, "lanes": [ "b225e24fa75d983a", "bd90d36b2d175c04", "5b529d3e6e085f85", "3215431145e2bf46", "f81092fb22f636d1", "2097c8aad6603e27", "31f2c561623fb1f7", "8fdf74f3f204df9c", "9f5e838db186c4ac", "a80a1c04bc11baa2", "bf130581a54ef742", "3092fccecda9f8bf", "1a8b8b2a4af00862", "60c4cc90d90ca705", "1f24793254851e4e", "631239dca84621ef", "4b3f7866395fe1bd", "30bef91bffc67d8a", "d272513dd6dd06c9", "25a3af600aecb585", "5fc53e5cb938bec8", "02fc22dcacbc3cc1", "668094928c4b6cc3", "d5c25129ae161a7d", "b5d89c9e96e91041" ] }
27{ "phase": "squeeze", "output_bytes": 32, "digest": "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532", "lanes": [ "b225e24fa75d983a", "bd90d36b2d175c04", "5b529d3e6e085f85", "3215431145e2bf46", "f81092fb22f636d1", "2097c8aad6603e27", "31f2c561623fb1f7", "8fdf74f3f204df9c", "9f5e838db186c4ac", "a80a1c04bc11baa2", "bf130581a54ef742", "3092fccecda9f8bf", "1a8b8b2a4af00862", "60c4cc90d90ca705", "1f24793254851e4e", "631239dca84621ef", "4b3f7866395fe1bd", "30bef91bffc67d8a", "d272513dd6dd06c9", "25a3af600aecb585", "5fc53e5cb938bec8", "02fc22dcacbc3cc1", "668094928c4b6cc3", "d5c25129ae161a7d", "b5d89c9e96e91041" ] }

Recorded result

{
  "digest": "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532",
  "blocks": 1
}

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.

Concept animation · Sponge absorb and squeeze

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.

Partition statePadded blockRate · 1088 bitsCapacity · 512Absorb padded messagePadded blockRate · 1088 bitsCapacity · 512Permute entire statePadded blockRate · 1088 bitsCapacity · 512Keccak-f[1600]Squeeze outputPadded blockRate · 1088 bitsCapacity · 512Keccak-f[1600]Digest · 256 bits

Step 1 of 4 · Partition state

Partition state

SHA3-256 uses 1600 bits: rate 1088 (136 bytes), capacity 512.

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

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

03 · Interactive simulation

Baseline diagram loaded. Interactive engine initializing…

Reference SVG (visible without scripts). Use the editable workstation below to calculate or run the experiment.
SHA3-256 · domain paddingSHA3-256 · domain paddingInput bytes3Rate bytes136Capacity bits512Domain suffix 0x06; final pad bit 0x8025 actual lanes; 17 rate lanes and 8 capacity lanes.

Select a calculated input fixture. These traces were generated and verified with the lab Python implementation; the browser replays recorded states. For arbitrary new inputs use the notebook or toolkit.

Verified baseline reference

Calculated result or labeled reference

{
  "digest": "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532",
  "blocks": 1
}
Complete trace

Dr. Mohammad · contextual guide

Guided simulation activity

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.

Continue to practical experiments →

04 · Experiments and engineering investigations

Analytical preparation — before Python

abc produces 3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532. A 135-byte input uses one padded block, 136 bytes use two.

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

For SHA3-256, compute rate and capacity from the 1600-bit state. For a short input, identify where the domain separator and final padding bit are placed. Label absorption, permutation and squeezing and explain why this is not SHA-512 compression.

02 · Sponge analysis

Sponge analysis · Independent work

SHA3-512 has capacity1024 of 1600 bits. Find rate in bits and bytes. Why is capacity not a direct output byte count?

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 · CR64-01

For the separate teaching-test configuration message: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, predict blocks 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 · CR64-02

A teaching trace for SHA-3 sponge: rate and capacity contains phase: absorb block; index: 0; block_bytes: 136; prefix: 6162630600000000. Explain the role of prefix (recorded value 6162630600000000) 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 · CR64-03

The first teaching trace contains phase: domain padding; input_bytes: 3; rate_bytes: 136; capacity_bits: 512; the last contains phase: squeeze; output_bytes: 32; digest: 3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532; lanes: ["b225e24fa75d983a", "bd90d36b2d175c04", "5b529d3e6e085f85", "3215431145e2bf46", "f81092fb22f636d1", "2097c8aad6603e27", "31f2c561623fb1f7", "8fdf74f3f204df9c", "9f5e838db186c4ac", "a8…. 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 · CR64-04

Plan a comparison of message: abc with message: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. Record the dependent value blocks, 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; run the integrated workstation or extracted toolkit. All classroom calculations run locally.

Install Python dependencies only if required by the selected toolkit README. Use its requirements file and virtual environment instructions.

Open complete, verified WSL commands in Part C ↓

01

SHA3-256 sponge and Keccak-f

  1. Write a prediction based on the worked example.
  2. Run abc and inspect the absorbed lane state, first and final permutation rounds and 32-byte squeezed output.
  3. Export the trace and compare the result with the reference.

Experimental inputs

Experimental reference · json
{"message":"abc"}
Verified baseline reference (check after predicting)
Experimental reference · json
{"digest":"3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532","blocks":1}

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

Padded block count, selected 25-lane states, 256-bit digest and independent hashlib check.

Run baseline →
02

Part D · Controlled investigation — SHA3-256 sponge and Keccak-f

  1. Compare 135 and 136 ASCII a bytes, then empty input. Inspect rate/capacity and count actual rounds.
  2. Record fixed settings and complete the comparison table.
  3. Measure Padded block count, selected 25-lane states, 256-bit digest and independent hashlib check. Explain the first differing state or invariant.
TrialInput configurationPredictionObservedVerification
1{"message":"abc"}
2{"message":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
3{"message":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
4{"message":""}

Use the table as a recording template; enter your own measured values in the field below or reproduce it in your report.

Return to simulation →
03

Part E/F · Independent Python verification and deliverables

  1. Download the notebook or toolkit and run the default example.
  2. Use python3 lab.py --inputs followed by the JSON from a trial. Compare exact math; for randomized or timed experiments compare invariants and report actual measurements separately.
  3. Complete the independent assessment below without copying the worked baseline. Explain discrepancies and distinguish mathematical results from security claims.
Additional investigation instructions
  1. Read the theory and prerequisite labs. Run the baseline and record the input and result.
  2. Compare abc and 136 bytes; calculate absorb block count and explain rate versus capacity.
  3. Locate the first intermediate step where the two cases differ. Verify the defining equation or decision rule.
  4. Submit a two-row comparison table, trace evidence and a conclusion with limitations.
CaseInputObserved resultVerificationLimitation
BaselineRecordRecordDeriveExplain
ChangedRecordRecordDeriveExplain

Part C · Python, Google Colab and WSL

WSL / Linux execution workflow

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).

Optional prerequisites · bash
sudo apt update
sudo apt install -y python3 python3-venv unzip

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 CR64
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.

Step 3 · Run and verify · bash
python lab.py | tee my-results.json
python test_lab.py
python lab.py --inputs "$(cat example-input.json)"
python -m json.tool my-results.json

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 --inputs "$(cat 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: # Python standard library only

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 CR64/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.

Verified execution excerpt · text
{
  "first_step": {
    "phase": "domain padding",
    "input_bytes": 3,
    "rate_bytes": 136,
    "capacity_bits": 512
  },
  "result": {
    "digest": "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532",
    "blocks": 1
  }
}

Test script output:
CR64 PASS

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.

Download the notebook, open Google Colab and upload it using File → Upload notebook. For local Linux/WSL execution, follow the command blocks below in order.

Inspect Python source
Documented Python implementation · python
# ------------------------------------------------------------
# PSUT IoT Engineering Studio | CR64
# Experiment: sha 3 sponge rate and capacity
# Purpose: expose algorithm states and verify the experiment invariant.
# ------------------------------------------------------------
# CR64 | SHA-3 sponge: rate and capacity
# Execute the named operation; expose states and assert the laboratory invariant.
import hashlib
import json



DEFAULT={'message': 'abc'}
ALTERNATE={'message': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}

def run(overrides=None):
    # Merge only explicitly supplied inputs with the reference baseline.
    params={**DEFAULT, **(overrides or {})}
    message=params['message']
    if not isinstance(message,str) or len(message.encode())>512: raise ValueError("Use 0–512 UTF-8 bytes")
    # Keccak-f[1600]: little-endian lanes indexed x+5*y; trace each complete round.
    mask=(1<<64)-1
    rc=[int(x,16) for x in "0000000000000001 0000000000008082 800000000000808a 8000000080008000 000000000000808b 0000000080000001 8000000080008081 8000000000008009 000000000000008a 0000000000000088 0000000080008009 000000008000000a 000000008000808b 800000000000008b 8000000000008089 8000000000008003 8000000000008002 8000000000000080 000000000000800a 800000008000000a 8000000080008081 8000000000008080 0000000080000001 8000000080008008".split()]
    offsets=[0,1,62,28,27,36,44,6,55,20,3,10,43,25,39,41,45,15,21,8,18,2,61,56,14]
    def rol(v,r): return ((v<<r)|(v>>(64-r)))&mask
    def lanes(a): return [f'{v:016x}' for v in a]
    m=message.encode();rate=136;blocks=(len(m)+1+rate-1)//rate
    padded=bytearray(m+b'\x06'+b'\0'*(blocks*rate-len(m)-1));padded[-1]|=0x80
    a=[0]*25;steps=[{'phase':'domain padding','input_bytes':len(m),'rate_bytes':rate,'capacity_bits':512}]
    for i in range(blocks):
        block=padded[i*rate:(i+1)*rate]
        for j in range(rate): a[j//8]^=block[j]<<(8*(j%8))
        steps.append({'phase':'absorb block','index':i,'block_bytes':rate,'prefix':bytes(block[:8]).hex(),'lanes':lanes(a)})
        for r in range(24):
            # theta mixes columns; rho rotates lanes; pi relocates lanes.
            c=[a[x]^a[x+5]^a[x+10]^a[x+15]^a[x+20] for x in range(5)]
            d=[c[(x+4)%5]^rol(c[(x+1)%5],1) for x in range(5)]
            a=[v^d[j%5] for j,v in enumerate(a)];b=[0]*25
            for x in range(5):
                for y in range(5): b[y+5*((2*x+3*y)%5)]=rol(a[x+5*y],offsets[x+5*y])
            # chi is nonlinear within rows; iota injects a round constant.
            a=[v^((~b[(j%5+1)%5+5*(j//5)])&b[(j%5+2)%5+5*(j//5)]) for j,v in enumerate(b)];a[0]^=rc[r]
            steps.append({'phase':'Keccak-f round','index':i,'round':r,'lanes':lanes(a)})
    digest=b''.join(v.to_bytes(8,'little') for v in a[:4]).hex()
    steps.append({'phase':'squeeze','output_bytes':32,'digest':digest,'lanes':lanes(a)})
    result={'digest':digest,'blocks':blocks}
    assert digest==hashlib.sha3_256(m).hexdigest()
    # Independently check the stated mathematical or protocol invariant.
    assert len(result["digest"])==64, "verification failed"
    return {"steps":steps,"result":result}

if __name__ == "__main__":
    import argparse
    parser=argparse.ArgumentParser();parser.add_argument("--inputs",default="{}");parser.add_argument("--test",action="store_true");args=parser.parse_args()
    if args.test:
        for case in [{},ALTERNATE]:run(case)
        print("PASS")
    else:print(json.dumps(run(json.loads(args.inputs)),indent=2))
Baseline reference (randomized fields may vary)
Reference result · json
{
  "digest": "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532",
  "blocks": 1
}

05 · Interactive flashcards

Recall before revealing. Review and mastery ratings remain on this device.

Browse all explanations
How wide is the rate?

1088 bits.

Which lanes receive input?

The 17 rate lanes; capacity is not directly XORed with message bytes.

What distinguishes SHA-3 from SHA-512?

Sponge permutation versus iterated compression.

How many Keccak-f rounds per absorbed block?

24

What evidence should be recorded?

Padded block count, selected 25-lane states, 256-bit digest and independent hashlib check.

How should the comparison be controlled?

Compare 135 and 136 ASCII a bytes, then empty input. Inspect rate/capacity and count actual rounds.

06 · Knowledge assessment

Compare 135 and 136 ASCII a bytes, then empty input. Inspect rate/capacity and count actual rounds. Submit the stated measurements, a reasoned comparison and independent verification. Criteria: mathematical correctness 40%, reproducibility 30%, interpretation 20%, limitations 10%.

Formative knowledge check

How many Keccak-f rounds per absorbed block?

Select one answer

Responses are for instructor review; no grading key is provided here.

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.

All Cryptography Engineering labsNext laboratory · CR65 →