In college I remember we had to implement Caesar (explained through addition in residue classes), Vignere (multiplication in residue classes) and then finally RSA (through potentiation in residue classes).
I haven't had a mathematical aha moment like that since.