[Edu-sig] Teaching RSA with Python

Kirby Urner urnerk at qwest.net
Fri Feb 18 21:50:30 CET 2005

Yo edu-siggers!

>From time to time over the years, I've hit this list with my evolving
understanding of RSA and how best to teach it -- RSA being a well-known
algorithm for encrypting a message to Bob with Bob's public key, perhaps
signing it with my own secret one, such that only Bob is able to decrypt my
message, and, upon decrypting the appended sig with my public key, confirms
it came from me.

My latest attempt along these lines is chronicled on a list for community
college math teachers, and rounds out a thread (started by another
subscriber) about Euclid's Extended Algorithm (EEA), a variation on the
simple gcd algorithm (EA).  RSA uses EEA in one of the steps.

Here's the thread, with my latest stuff on RSA posted today (Feb 18, 2005):


This post links, in turn, to actual Python source code at my 4dsolutions.net
web site.  I've been developing this material for Saturday Academy, which
offers an extraordinary curriculum to pre-college age students.

One difference in this latest representation is I rely on the mx module to
test for an integer's primality, which tests may include using
Miller-Rabin's.  This makes for less clutter and snappier performance
(although speed is not a goal here, more transparency and cogent expression
-- which is where Python comes in).

Adjunct Faculty
Portland State University

More information about the Edu-sig mailing list