Below are links to some LaTeX notes and Maple notebooks that I wrote to explain and demonstrate how RSA encryption works. I presented this in our Applied Math Seminar in the spring of 1998.
This is a link to (roughly) thirty nicely TeXed pages explaining the underlying number theory and RSA algorithm.
Here are some associated notes on factoring.
Here's a Maple notebook to demo Euclid's Algorithm.
Thie Maple notebook shows how to implement the Miller-Rabin probablistic test for primality.
This Maple notebook demos a simple exponentiation cipher.
And here is the Maple code to demo RSA encryption and the basic idea of digital signatures.