LAB TCP / STUDENT HANDBOOK / ENGLISH EDITION
Six online laboratories with worked examples, practical steps and checks for your own variant.
Open the classroom link in a browser. Select a laboratory and your assigned variant, choose an exercise and click Start / resume variant. All ciphertexts are already on the site; you do not need to download or upload anything.
Inputs, parameters, experiment results and your conclusion save automatically in this browser on this device. Changing exercises keeps separate attempts. Reopening the same site restores the last attempt. Clearing browser data or using another device will not preserve it.
Each chapter contains a small, fully explained demonstration and a procedure for your own variant. Demonstration messages and keys are teaching examples, not answers to assessed variants. Use the same reasoning with your assigned ciphertext.
The English alphabet has 27 symbols: A=0, B=1, ..., Z=25 and space=26. Spaces are encrypted. Use uppercase A-Z and spaces. Normalize text only for your own plaintext. Position controls start at 1; technical offset and step fields in JSON start at 0.
Labs 1-5 have variants 1-30. Lab 4 has two exercise files; Lab 5 has three. Lab 6 has variants 1-25. Your instructor assigns the number. All 265 exercise files are available on the website.
State a hypothesis, choose an action, inspect the result, accept or reject the hypothesis with a reason, then record the conclusion. Review experiment log shows the parameters and results without downloading a file.
LABORATORY 1
Objective. Recover a one-to-one substitution by combining symbol counts and word patterns.
Every occurrence of a plaintext symbol is replaced by the same ciphertext symbol. Counts stay unchanged. For a symbol with n occurrences in a message of length N, its relative frequency is n/N. Compare frequencies as evidence, not as a guaranteed dictionary.
Plaintext
MEET ME AT THE LIBRARY
Ciphertext
DTTZ DT QZ ZIT SOWKQKN
A useful observation
There are 22 symbols. T occurs 4 times: 4/22 = 18.18%. Try T=E. Z occurs 3 times; the short word ZIT suggests THE, so try Z=T and I=H.
Partial mapping
D=M; T=E; Z=T; I=H; S=L; O=I; W=B; K=R; Q=A; N=Y; [space]=[space]
Recovered message
MEET ME AT THE LIBRARY
Common mistake. Do not automatically map the most frequent ciphertext symbol to E. In these tasks a space is also a symbol and may be more frequent than any letter.
LABORATORY 2
Objective. Find a Vigenere period and recover one shift for each periodic group.
Use A=0, B=1, ..., Z=25, space=26. Encryption is c=(m+k) mod 27; decryption is m=(c-k) mod 27. A key repeats over every character, including spaces. A candidate period p partitions the ciphertext into p groups. Each group uses a single shift.
Demo plaintext
MEET ME AT THE OLD BRIDGE
Demo key
LEMON
Demo ciphertext
XIQGMXILOFKXTSMZPPNOBMPUR
First symbol
M=12, L=11, so (12+11) mod 27=23, which is X. Reverse check: (23-11) mod 27=12, which is M.
A wraparound example
At position 4, T=19 and O=14. Their sum is 33; 33 mod 27=6, so the ciphertext symbol is G.
The space matters
At position 5, space=26 and N=13. The result is 12=M. Skipping the space would shift every later key position.
| Position | Plain | Code | Key | Code | Cipher | Code |
|---|---|---|---|---|---|---|
| 1 | M | 12 | L | 11 | X | 23 |
| 2 | E | 4 | E | 4 | I | 8 |
| 3 | E | 4 | M | 12 | Q | 16 |
| 4 | T | 19 | O | 14 | G | 6 |
| 5 | [space] | 26 | N | 13 | M | 12 |
| 6 | M | 12 | L | 11 | X | 23 |
| 7 | E | 4 | E | 4 | I | 8 |
| 8 | [space] | 26 | M | 12 | L | 11 |
Common mistake. Do not use modulo 26. This classroom alphabet contains 27 symbols because space participates in encryption.
LABORATORY 3
Objective. Recover a composite periodic key and investigate the primary repeating keys.
Two periodic keys add at each position: c=(m+k1+k2) mod 27. Their composite period divides LCM(u,v), where u and v are the primary lengths. It can be smaller. The primary keys are not unique: add a constant shift to one and subtract it from the other.
Demo primary keys
GO (length 2) and SUN (length 3). LCM(2,3)=6.
Key streams
G O G O G O S U N S U N
Composite key
YHTF A
First composite symbol
G=6 and S=18, so 6+18=24=Y. At position 5, G=6 and U=20 give 26, which is a real space.
Demo ciphertext
JLXYZMBGTYZTELSQHBOHJC
Recovered plaintext
MEET ME AT THE LIBRARY
Common mistake. A program-generated decomposition is one valid numerical solution. Its first pair need not form meaningful words, and the source data alone may not identify a unique word pair.
LABORATORY 4
Objective. Use a guessed plaintext fragment to reveal a key fragment, then validate the hypothesis globally.
A probable word, or crib, gives k=(c-m) mod 27 at its proposed location. A short periodic key must be consistent wherever the same key position recurs. A running key has no periodicity requirement and must cover the entire message.
Short-key demo ciphertext
EHXGWEQGUSSOUDWLZ AULT LLBGVW
Crib and position
Assume THE KEY at position 1, with period 4.
Derived key fragment
MATHMAT
Consistent short key
The fragment MATHMAT repeats consistently with period 4. Enter MATH and decrypt.
Recovered plaintext
THE KEY IS HIDDEN IN THE BOOK
Running-key contrast
Ciphertext: JLECLTWDHEDEFZVOEOUSN Crib THE MAP at position 1 reveals key fragment READ TH. With period 0, this is evidence about a running text, not a repeating seven-letter key.
Common mistake. The crib is assumed, not known. A readable fragment at the guessed location alone is not proof that the rest of the message is correct.
LABORATORY 5
Objective. Recover symbol order in a block, along a graph path, and in a table.
A transposition changes order, not symbol counts. Block and Hamiltonian modes use C_i=M_(key_i). Table mode uses the inverse convention C_(key_i)=M_i inside each column. Keys contain each position from 1 to N exactly once.
Block demo
Plaintext: MEETMEATNOONXXX Key: 3 1 5 4 2 Ciphertext: EMMTETEONAXOXXN
One block by hand
MEETM -> EMMTE. Read plaintext positions 3,1,5,4,2. To invert, place ciphertext characters back into those positions.
Graph demo
Graph 1, path 1 2 3 6 4 5. Every consecutive pair is an edge, and all six vertices occur once. SECRET becomes SECTRE.
Table demo
Plaintext MEETMEATNOON is written down columns with 4 rows. Natural rows are MMN / EEO / EAO / TTN. Key 3 1 4 2 sends original row 1 to destination row 3, row 2 to row 1, row 3 to row 4 and row 4 to row 2.
Table ciphertext
ETMEETMAONNO
Open all five numbered Hamiltonian graphs
Common mistake. A high bigram score is a ranking heuristic, not a proof. The search returns only its best 30 candidates. Do not silently remove padding before reverse verification.
LABORATORY 6
Objective. Recover a seven-stage linear recurrence from a probable bigram and decrypt a 16-byte message.
XOR operates bit by bit: 0 XOR 0=0, 0 XOR 1=1, 1 XOR 0=1 and 1 XOR 1=0. Encryption is C=P XOR G, so G=C XOR P. English characters use ASCII bytes, most significant bit first. A 16-byte message produces 128 bits.
Demo plaintext
SEND THE MESSAGE
First two ciphertext bytes
1100010000110110
Guess SE at position 1
S is 01010011 and E is 01000101. Their concatenation is 0101001101000101.
Known keystream fragment
1001011101110011
Recovered recurrence
L=7; C=[1,0,0,0,0,0,1,1]. In this convention, s_n=s_(n-6) XOR s_(n-7). Initial output bits: 1001011.
What must be checked
Extend the recurrence to all 128 bits. XOR with the ciphertext and recover SEND THE MESSAGE. The full message, not only SE, must be meaningful and reverse-check exactly.
| Step n | Bit | Discrepancy | L | C coefficients |
|---|---|---|---|---|
| 0 | 1 | 1 | 1 | [1, 1] |
| 1 | 0 | 1 | 1 | [1, 0] |
| 2 | 0 | 0 | 1 | [1, 0] |
| 3 | 1 | 1 | 3 | [1, 0, 0, 1] |
| 4 | 0 | 0 | 3 | [1, 0, 0, 1] |
| 5 | 1 | 1 | 3 | [1, 0, 1, 1] |
| 6 | 1 | 0 | 3 | [1, 0, 1, 1] |
| 7 | 1 | 0 | 3 | [1, 0, 1, 1] |
| 8 | 0 | 0 | 3 | [1, 0, 1, 1] |
| 9 | 1 | 1 | 7 | [1, 0, 1, 1, 0, 0, 1, 0] |
| 10 | 1 | 0 | 7 | [1, 0, 1, 1, 0, 0, 1, 0] |
| 11 | 1 | 1 | 7 | [1, 0, 0, 1, 1, 1, 1, 0] |
| 12 | 0 | 1 | 7 | [1, 0, 0, 0, 1, 0, 0, 0] |
| 13 | 0 | 1 | 7 | [1, 0, 0, 0, 0, 0, 1, 1] |
| 14 | 1 | 0 | 7 | [1, 0, 0, 0, 0, 0, 1, 1] |
| 15 | 1 | 0 | 7 | [1, 0, 0, 0, 0, 0, 1, 1] |
Common mistake. The coefficient vector defines a recurrence, not an unspecified drawing of register taps. State the convention explicitly. UTF-8 must not be used for byte calculations on original Russian material.
Enter your student label or group if required, state the lab and variant, and write your recovered key and plaintext in the conclusion. Explain at least two rejected hypotheses and one accepted hypothesis. Include the manual calculations requested in the chapter.
Whenever possible, apply the inverse operation to your recovered result and reproduce every symbol or bit of the original ciphertext. Keep spaces and padding. A good-looking beginning is weaker evidence than a complete exact reverse check.
The current version does not submit work to an instructor automatically. Follow the submission method your instructor announces. If requested, the optional Download report and protocol buttons provide a portable copy; Show protocol text is a manual backup alternative.
If you see a storage warning, keep the tab open and copy the protocol text. If a mapping or key is rejected, read the error and check the alphabet, key uniqueness, length, graph constraints and spaces. Reset this attempt clears only the selected attempt after confirmation.
| Criterion | Points out of 20 |
|---|---|
| Method and manual calculation | 4 |
| Reasoned, reproducible hypothesis testing | 6 |
| Correct result and reverse verification | 6 |
| Conclusion and explanation | 4 |
Prepared for the Lab TCP online classroom. Demonstrations use small synthetic examples. Assessed variant answer keys are not included.