Waleed Bukhari

Open to SOC Analyst and blue-team roles

All work

Cryptography and encryption

Cipher design, RSA cryptanalysis and protocol attack simulation

Context
Coursework · Applied cryptography
Year
2025
The cipher’s 30-symbol alphabet, one cell each. Brightness shows where f(x) = (7x + 4) mod 30 sends the symbol.

Problem

Cryptographic security depends on more than strong primitives: parameter choices, key management and protocol freshness decide whether a system actually holds. The brief required demonstrating both how schemes work and exactly how they fail.

A combined Industrial Cryptography coursework covering both construction and cryptanalysis: designing a working cipher, then breaking real protocol weaknesses with the underlying number theory.

What I did

I implemented a modified Affine cipher over a 30-character domain, then mounted a ciphertext-only common-modulus RSA attack using the Extended Euclidean Algorithm, and finally simulated replay and impersonation attacks step-by-step against symmetric key-exchange protocols.

Modified Affine cipher

A 30-symbol alphabet (A to Z plus +, −, *, /) with f(x) = (7x + 4) mod 30. k₀ = 7 is coprime to 30 (gcd = 1), so the map is a bijection; the modular inverse 13 (7·13 ≡ 1 mod 30) drives decryption. The tests check that the map is collision-free across the whole alphabet. Like any affine cipher it has a tiny keyspace and falls to frequency analysis: it illustrates modular arithmetic, not a secure design.

RSA common-modulus attack

The precondition: the same message is encrypted to two users who share a modulus N and have coprime public exponents. An interceptor holding both ciphertexts can then recover the plaintext with no private key: solve s·eA + t·eB = 1 with the Extended Euclidean Algorithm, then compute m = CA^s · CB^t mod N. Key generation and parameter separation matter as much as the maths.

Protocol attacks & mitigations

I demonstrated a Needham-Schroeder replay (an exposed old session key Kab accepted as fresh because B never verifies freshness) and a Diffie-Hellman-variant impersonation under key compromise.

  • Needham-Schroeder: add timestamps / B-originated nonce challenges
  • DH variant: enforce mutual authentication, key rotation and ephemeral DH for forward secrecy

Evidence

Symbol cipher alphabet
30
A to Z plus four symbols, k₀ = 7
Schemes analysed
4
Affine · RSA · NS · DH
Private keys needed for the RSA break
0
if one message goes to two users sharing a modulus
Unit tests
10
in the public repo

Stack and tools

  • Modular Arithmetic
  • Extended Euclidean Algorithm
  • RSA
  • Needham-Schroeder
  • Diffie-Hellman

Result

A coursework demonstrating end-to-end cryptographic literacy, from hand-built ciphers to protocol cryptanalysis, with each weakness paired to a defensible mitigation grounded in academic sources.