The Raspberry Pi Foundation and UK Government code breaking facility GCHQ have got together to create a public key encryption teaching resource. Find it here and a blog introducing it here. Be warned, if you want to finish the whole educational unit, you will need to build yourself an eight-Raspberry Pi (32 core) mini-supercomputing cluster.
This story continues at Raspberry Pi and GCHQ teach encryption
Or just read more coverage at Electronics Weekly