NUS · CS4236 Cryptography in Practice · Aug 2026, in progress
EduCrypto
CS4236 was recently redesigned away from proving theorems and toward using cryptography correctly in real systems: reading an application's security requirements, choosing the right primitive, picking a sound library implementation, and getting the parameters right. The semester's spine is a library called educrypto that I build up week by week, and the reason it sticks is that every primitive I implement, I then have to attack.
01How the semester is structured
Each week the module publishes three things: a feature request with an API and its behavioural requirements, a public pytest suite, and a deliberately vulnerable service that uses the library. I implement the primitive into educrypto so the tests pass, then write the attack that breaks the service built on top of it. Both halves live in the same repository, the library under src/educrypto and the attacks in their own module.
The vulnerable services are small Flask applications, which is a pointed choice. The bug is never in the mathematics. It is in how the primitive got used: a reused key, a parameter left at its convenient default, ciphertext nobody authenticated, an API that made the unsafe call the easy one.
02Where it ends up
By December this should be a working Python cryptography package covering symmetric encryption and its modes, message authentication and hashing, then the public-key half: RSA, Diffie-Hellman key exchange, El Gamal, and digital signatures, each with a matching attack demonstrating the failure mode when it is deployed carelessly. The later part of the course moves toward how these compose into real protocols, and where cryptography sits in modern systems like blockchain and privacy-preserving machine learning.
It builds on CS2107, the information security module, which is where the threat-modelling half of my thinking came from. This one is the implementation half.
next project
This Website →