1. Task A: Frequency Analysis and Breaking Monoalphabetic Substitution Cipher
The monoalphabetic substitution cipher replaces each letter in the plaintext with a fixed substitute, creating a consistent one-to-one mapping. Though simple to implement, it's highly vulnerable to frequency analysis since the substitution pattern remains unchanged (Aumasson et al. 2024). In Task A, the challenge was to decrypt a given ciphertext by using both analytical techniques and computational tools to reveal the original message hidden behind the cipher.
Struggling to hit top grades? Explore free, top-quality coursework samples from the Best Assignment Writing Service Australia.
1.1 Data Preparation
The ciphertext included full sentences with punctuation and spaces. To prepare it for frequency analysis, all non-letter characters were removed using Python's regular expressions. This cleanup ensured more accurate results (Banoth & Regar 2023). Then, single-letter frequencies were counted to find the most common letters. Additionally, diagrams and trigrams were analyzed to detect repeating patterns often found in English, helping guide the decryption process more effectively and systematically.
1.2 Frequency Analysis and Pattern Recognition
The cleaned text showed repeating patterns like "sln," which appeared 13 times. This pointed to "the" in English, leading to possible mappings: 's' → 't', 'l' → 'h', and 'n' → 'e'. Another frequent pattern, "tgg," was likely "all," giving 't' → 'a' and 'g' → 'l'. These clues, combined with context, helped identify further letter mappings like 'm' and 'k' through their proximity to known letters.
1.3 Partial Decryption
After creating an initial letter map, the ciphertext was partly decrypted by swapping known letters for their probable plaintext equivalents, while unknown letters were marked with underscores. This helped identify word patterns, making it easier to guess missing letters. Gradually, as more letters were identified, the message became clearer (Harris 2025). This careful, step-by-step approach showed that frequency analysis and pattern recognition can successfully reveal the original text without having the entire cipher key.
Figure 1: Letter frequencies, top diagrams/trigrams, and the partially decrypted plaintext generation


The results demonstrate that monoalphabetic substitution ciphers can be broken using frequency analysis and pattern recognition. By studying common English words and letter patterns, partial decryption was possible (Banoth & Regar 2023). This method highlights the weaknesses of classical ciphers against analytical attacks. It also shows the need for stronger, more sophisticated encryption methods in modern cryptography to protect information more securely.
2. Task B — 16-round Feistel with identity round function
Problem. What is the output of a 16-round Feistel network when the input is and the round function is the identity ? Show detailed steps.
Notation. Let the input to round be . The standard Feistel round update is

Here denotes bitwise XOR. The initial state is . In this task is the identity function, so and the round equations simplify to


Compute the first rounds explicitly.
- Round 0 → Round 1

- Round 1 → Round 2

- Round 2 → Round 3

It notices that after three rounds the state returns to the original input:

Observe the cycle. The sequence of states therefore repeats with period :

Hence for any integer ,

Apply this to 16 rounds. Since the states repeat every 3 rounds, it reduced modulo :

Therefore the state after 16 rounds equals the state after 1 round:

Final answer (output after 16 rounds):

3. Task C: Recovering Plaintext from Ciphertext in OFB Mode with Fixed IV
Output Feedback (OFB) mode turns a block cipher into a stream cipher by creating a keystream that is XORed with the plaintext. Its security relies on using a unique initialization vector (IV) each time. In Task C, the programmer fixed the IV, making the keystream predictable and repeatable. This flaw allowed the keystream to be recovered, exposing the ciphertext to potential decryption and compromising the encryption’s security.
Students exploring classical and modern cryptography, cipher attacks and encryption weaknesses can seek Cryptography Assignment Help for academic guidance
3.1 Vulnerability Analysis
Using a fixed IV in OFB mode caused the encryption to produce the same keystream for every message. Since each keystream block depends on the previous one, starting with the same IV means the keystream repeats (Peter 2025). This reuse weakens security, allowing attackers to recover ciphertexts encrypted with that IV if they have access to an encryption oracle, exposing the encrypted data to potential compromise.
3.2 Keystream Recovery
To recover the plaintext, the encryption oracle was given a known input of all zeros. Because XOR with zero leaves data unchanged, the returned ciphertext revealed the keystream directly. Python code converted the hex ciphertext into bytes to extract this keystream (James 2025). This process shows how a fixed IV makes the keystream predictable and emphasizes why using random IVs is essential for secure stream cipher encryption.
3.3 Plaintext Recovery

Figure 2: Output of the recovered plaintext in hexadecimal and ASCII format, highlighting non-printable characters
Using the keystream from the oracle, the target ciphertext was XORed byte-by-byte with it to reveal the original plaintext (Ketha 2023). This worked because XOR is a linear operation. The process showed that any message encrypted with the same fixed IV is at risk, as the repeated keystream makes it easy to decrypt and exposes the data to attackers.
Figure 3: Plaintext in hexadecimal to Ciphertext conversion

The recovered plaintext was checked in both hexadecimal and ASCII forms, proving the attack’s success. In this task, the weakness identified is a realistic weakness due to bad IV dealing in the OFB mode. Through the utilisation of the fixed IV and oracle encryption, the full plaintext was reconstructed (Yadav 2025). It emphasises the importance of adequateness of IV randomness and demonstrates how minor errors in the procedure may entirely undermine the security of encrypted data.
4. Task D: Attack on Regev Encryption Scheme when m = n
According to the Regev encryption scheme, the Learning With errors (LWE) problem is utilised when the number of equations (m) is significantly bigger than the dimension of a secret (n). In Task D, the evaluation of m which is n jeopardised security as the generated set of linear equations was easy to solve (Radanliev 2023). Such a direct solvability reveals the scheme to be vulnerable, coming as it does having as many equations as the dimension of the secret to allow the ciphertext to be kept secure.
4.1 Vulnerability Analysis
In Regev encryption, the ciphertext consists of c=(A,b=As+e+m (q/2) and A is a matrix, s the secret vector, e a small error, and m a message. Under condition of equal equations that will represent the dimension of the secret, the system is square (Mohammed et al. 2024). Provided AT A is invertible over q the message can be deanonymized using linear algebra and in spite of the small error.
4.2 Attack Methodology
Figure 4: Recovered Plaon text

Recovery of the plaintext was accomplished by estimating the secret vector in the Regev ciphertext first by modular linear algebra. All the components of the resultant vector were computed to determine the difference against the ciphertext with a modulus of the scheme. Censoring these values enabled them to be classified in bits that denoted 0 or 1. These bits were then joined in bones in order to re-assemble the message. The approach shows the procedure by which the plaintexts can be fully recovered by choosing insecurely (m = n ).The algorithmic attack was the calculation of the modular inverse of ATA, ATA modulo qqq, by means of the Gaussian elimination. Multiplication of the inverse and the ciphertext vector provides the approximation of message contribution in the modular space. The modular arithmetic and little error was controlled by centering the results in the interval [ -q/2, q/2][-q/2, q/2 [ -q/2, q/2]. Threshofting was then used in order to tell bits that were 0 and bits that were 1 so that the original message could be prived. An automated processing of this calculation was written in Python code and generated intermediate values including the centred vector and modular residuals, doing so to verify them (James 2025). This assignment emphasises the need to follow theoretical parameter requirements in lattice-based cryptography. In nm = м2 = n2 = numpublic key the linear character of the m-encrypted messages allows complete decryption of the messages using modular linear algebra. The attack described by the exercise provides a concrete example of an attack on Regev encryption with insecure parameter selection and pushes the point of the critical implementation of post-quantum cryptographic protocols.
Reference List
Journals
- Aumasson, J. P. (2024). Serious cryptography: a practical introduction to modern encryption. No Starch Press, Inc. [Retrieved From: https://books.google.com/books?hl=en&lr=&id=KdIEEQAAQBAJ&oi=fnd&pg=PR17&dq=BREAKING+CLASSICAL+AND+MODERN+CRYPTOGRAPHIC+SYSTEMS:+AN+ANALYTICAL+AND+PRACTICAL+APPROACH+TO+CIPHER+ATTACKS+AND+ENCRYPTION+WEAKNESSES&ots=pWPHID9yRm&sig=t1jceEANSMfaOKvXDVhm-cat6RY] [Retrieved On: 18.08.2025]
- Banoth, R., & Regar, R. (2023). An introduction to classical and modern cryptography. In Classical and Modern Cryptography for Beginners (pp. 1-46). Cham: Springer Nature Switzerland. [Retrieved From: https://link.springer.com/chapter/10.1007/978-3-031-32959-3_1] [Retrieved On: 18.08.2025]
- Banoth, R., & Regar, R. (2023). Classical and Modern Cryptography for Beginners (pp. 1-215). Springer. [Retrieved From: https://link.springer.com/content/pdf/10.1007/978-3-031-32959-3.pdf] [Retrieved On: 18.08.2025]
- Banoth, R., & Regar, R. (2023). Security Standards for Classical and Modern Cryptography. In Classical and Modern Cryptography for Beginners (pp. 47-83). Cham: Springer Nature Switzerland. [Retrieved From: https://link.springer.com/chapter/10.1007/978-3-031-32959-3_2] [Retrieved On: 18.08.2025]
- Harris, L. (2025). CRYPTANALYSIS TECHNIQUES: THREATS TO MODERN CRYPTOGRAPHIC SYSTEMS. [Retrieved From: https://www.researchgate.net/profile/Lorenzaj-Harris/publication/393975714_CRYPTANALYSIS_TECHNIQUES_THREATS_TO_MODERN_CRYPTOGRAPHIC_SYSTEMS/links/688222c74eccfb3f29c4b5c9/CRYPTANALYSIS-TECHNIQUES-THREATS-TO-MODERN-CRYPTOGRAPHIC-SYSTEMS.pdf] [Retrieved On: 18.08.2025]
- James, P. (2025). A SURVEY OF CLASSICAL AND MODERN CRYPTOGRAPHIC TECHNIQUES FOR SECURE COMMUNICATION. [Retrieved From: https://www.researchgate.net/profile/Paul-James-35/publication/392338236_A_SURVEY_OF_CLASSICAL_AND_MODERN_CRYPTOGRAPHIC_TECHNIQUES_FOR_SECURE_COMMUNICATION/links/683e928c6b5a287c3048e2f6/A-SURVEY-OF-CLASSICAL-AND-MODERN-CRYPTOGRAPHIC-TECHNIQUES-FOR-SECURE-COMMUNICATION.pdf] [Retrieved On: 18.08.2025]
- James, P. (2025). CRYPTANALYSIS TECHNIQUES: THREATS TO MODERN CRYPTOGRAPHIC SYSTEMS. [Retrieved From: https://www.researchgate.net/profile/Paul-James-35/publication/393977220_CRYPTANALYSIS_TECHNIQUES_THREATS_TO_MODERN_CRYPTOGRAPHIC_SYSTEMS/links/68824d80253dcb78df879a99/CRYPTANALYSIS-TECHNIQUES-THREATS-TO-MODERN-CRYPTOGRAPHIC-SYSTEMS.pdf] [Retrieved On: 18.08.2025]
- Ketha, A. (2023). The Evolution of Cryptography and a Contextual Analysis of the Major Modern Schemes. [Retrieved From: https://nhsjs.com/wp-content/uploads/2024/04/The-Evolution-of-Cryptography-and-a-Contextual-Analysis-of-the-Major-Modern-Schemes.pdf] [Retrieved On: 18.08.2025]
- Mohammed, S. A., Chhajed, K. K., Nichat, M. K., & Kute, V. B. (2024). Cryptography and Network Security in Modern Era. Academic Guru Publishing House. [Retrieved From: https://books.google.com/books?hl=en&lr=&id=JDxHEQAAQBAJ&oi=fnd&pg=PA1&dq=BREAKING+CLASSICAL+AND+MODERN+CRYPTOGRAPHIC+SYSTEMS:+AN+ANALYTICAL+AND+PRACTICAL+APPROACH+TO+CIPHER+ATTACKS+AND+ENCRYPTION+WEAKNESSES&ots=QJTsETjmt5&sig=75uZZz_7t4cFQWu1pWCANqHQwFU] [Retrieved On: 18.08.2025]
- Peter, I. (2025). Cryptanalysis Techniques and Their Role in Modern Cryptography. [Retrieved From: https://www.researchgate.net/profile/Iris-Peter-2/publication/393922370_Cryptanalysis_Techniques_and_Their_Role_in_Modern_Cryptography/links/68803209ba8eac4f17284b91/Cryptanalysis-Techniques-and-Their-Role-in-Modern-Cryptography.pdf] [Retrieved On: 18.08.2025]
- Radanliev, P. (2023). Cyber-attacks on Public Key Cryptography. [Retrieved From: https://www.preprints.org/frontend/manuscript/def0816463c19ad212947d5626362902/download_pub] [Retrieved On: 18.08.2025]
- Rajasekar, V., Premalatha, J., Dhanaraj, R. K., & Geman, O. (2022). Introduction to classical cryptography. Quantum Blockchain: An Emerging Cryptographic Paradigm, 1-29. [Retrieved From: https://onlinelibrary.wiley.com/doi/abs/10.1002/9781119836728.ch1] [Retrieved On: 18.08.2025]
- Yadav, A. (2025). Historical Roots of Modern Cryptography A Study of Substitution and Transposition Ciphers. [Retrieved From: https://npgcij.com/wp-content/uploads/2025/08/Historical-Roots-of-Modern-Cryptography-1.pdf] [Retrieved On: 18.08.2025]