Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cryptography II (Asymmetric & Post-Quantum) [Le...

Cryptography II (Asymmetric & Post-Quantum) [Lect 4: Competitive Cybersecurity 101]

This lecture tackles the key distribution problem by introducing asymmetric cryptography, focusing on the mathematical foundations of RSA and the Diffie-Hellman key exchange. Students learn how digital signatures reverse RSA keys to prove identity rather than secrecy. The session also looks to the future, exploring the existential threat that Shor's Algorithm and quantum computing pose to current encryption standards, and introduces Post-Quantum Cryptography (PQC) like lattice-based cryptography. Practical CTF skills include using `gmpy2`, FactorDB, and `RsaCtfTool` to exploit weak RSA implementations.

Kannan Murugapandian

October 13, 2026

Transcript

16 slides
  1. Competitive Cybersecurity 101 Session 4: Cryptography II (Asymmetric & Post-Quantum)

    Kannan Murugapandian July 31, 2026 Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 1 / 16
  2. Disclaimer & Ethical Rules Strictly for Educational Purposes All knowledge

    and tools must only be applied in environments where you have explicit permission. Do not test on systems you do not personally own or lack authorization to assess. Unauthorized access constitutes a criminal offense under the Computer Misuse Act. Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 2 / 16
  3. Today’s Agenda The Problem: Key Distribution Asymmetric Crypto: RSA &

    Diffie-Hellman Authentication: Digital Signatures The Future: Quantum Threats & Post-Quantum Crypto Hands-On: RSA Mini-Challenge Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 3 / 16
  4. Recap: The Key Distribution Problem Symmetric Encryption (Session 3): Uses

    the same key to lock and unlock. Extremely fast. The Problem: How do you safely send the secret key to your friend over the internet without a hacker intercepting it? Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 4 / 16
  5. Asymmetric Cryptography (The Solution) The Concept: Use two different keys.

    Public Key: Shared with everyone. Used to encrypt. Private Key: Kept secret. Used to decrypt. The Analogy: A padlock. Anyone can snap it shut (Public), but only you have the physical key to open it (Private). Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 5 / 16
  6. RSA: The King of Asymmetric Crypto How it works: Relies

    on the mathematical difficulty of factoring large prime numbers. The Math Trick: Easy: Multiply two huge prime numbers together. Hard: Take that massive result and figure out which two primes created it. Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 6 / 16
  7. RSA in CTFs (The Reality) What you will see: You

    will not be asked to write RSA from scratch. You will be given parameters: n (modulus), e (public exponent), and c (ciphertext). Your Goal: Find the prime factors of n (usually named p and q) to calculate the private key. Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 7 / 16
  8. CTF Tools for RSA Work smart, not hard! FactorDB.com: An

    online database of already-factored numbers. Always check here first! RsaCtfTool: A powerful Python script that automatically tries dozens of mathematical attacks on weak RSA keys. CyberChef: Has a built-in ”RSA Decrypt” recipe. Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 8 / 16
  9. Python: RSA Math in CTFs When you have the primes,

    we use the gmpy2 library for fast, large-number math. import gmpy2 p = 61; q = 53; e = 17; c = 213 # 1. Calculate Euler ’s Totient ( phi ) phi = ( p - 1) * ( q - 1) # 2. Find private key ( d ) using modular inverse d = gmpy2 . invert (e , phi ) # 3. Decrypt the ciphertext ( c ) m = pow (c , d , p * q ) print ( f " Flag number : { m } " ) Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 9 / 16
  10. Diffie-Hellman Key Exchange The Concept: Allows two people to create

    a shared secret key over a public, monitored channel. The Analogy (Mixing Paint): You both agree on a public base color (Yellow). You mix in your secret colors privately, swap them, and mix again. You both end up with the exact same final color, but an eavesdropper cannot reverse-engineer it! Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 10 / 16
  11. Digital Signatures The Concept: Reversing the RSA keys! Encrypt a

    message hash with your Private Key. Anyone can decrypt it using your Public Key. Why do this? It doesn’t hide the data. It proves identity. If your Public Key unlocks it, it mathematically proves only you could have signed it. Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 11 / 16
  12. The Quantum Threat The Problem with Quantum Computers: They process

    information using ”Qubits” (superposition). Shor’s Algorithm: A quantum algorithm that can factor large primes exponentially faster than normal computers. The Result: A powerful quantum computer will completely break RSA and current Asymmetric cryptography. Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 12 / 16
  13. Post-Quantum Cryptography (PQC) The Solution: New mathematical puzzles that even

    quantum computers struggle to solve. Examples: Lattice-based cryptography: Finding the nearest point in a multi-dimensional grid. Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 13 / 16
  14. Mini Challenge: The Weak RSA Key Scenario: You intercepted an

    RSA public key where n = 3233. Your Tasks: 1 Realize that 3233 is suspiciously small. 2 Use Python or FactorDB to find the two prime factors (p and q). 3 Use the gmpy2 script from earlier to calculate the private key and decrypt the ciphertext! Practice on the course hub: kannan.bearblog.dev/ctf-dps/ Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 14 / 16
  15. Key Takeaways Asymmetric Crypto solves the key-sharing problem using Public/Private

    key pairs. RSA relies on the difficulty of prime factorization. Digital Signatures prove identity, not secrecy. Quantum Computers will eventually break RSA, leading to Post-Quantum Crypto. Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 15 / 16
  16. Thank You! Questions? Email: [email protected] Course Hub: kannan.bearblog.dev/ctf-dps/ Next Session:

    Forensics I (Files, Metadata & Steganography) August 07, 2026 Kannan Murugapandian Competitive Cybersecurity 101 July 31, 2026 16 / 16

More Decks by Kannan Murugapandian

Other Decks in Technology