Sat, 11 Nov 2000 09:36:20 +0200
>I think this is an excellent idea. Crypto is hard to learn because (a)
>proving that it's hard to crack requires complex formal mathematical
>constructions, and (b) any real crypto uses numbers too big to write down,
>let alone think about.
Re big numbers: I think it really open things up for kids that
we have big integers easily available now. Even though we're
doing all the same ops, there's a psychological bridge that gets
crossed when the numbers start taking a couple paragraphs or even
pages to write down. For one thing, you really start to appreciate
that we have computing machinery, and that opens up the space for
a discussion of how that came to be (another thread in
Cryptonomicon -- because of course Turing was involved in the
war effort to break German and Japanese codes, and it was this
push which led to the faster evolution of digital computing).
Java also has a BigNumber class, and an op for spitting out
large numbers with a percentage change that said numbers are
prime (you approach a probability of 1 depending on how
computationally intensive you want to get -- I haven't
studied the source for this, am curious what algorithms
are used (would like to see them re-expressed in Python,
just for reference)). Probably the Java methods are
inherited from some well-known C library and the code is
in some numerical recipes book I haven't studied yet.
>A clear implementation of various crypto algorithms in Python would be a
>great thing to have around. If we can take its bit-length down to, oh,
>9, then the numbers are numbers high-schoolers can crunch in a class
>period with a calculator, but the computer can take care of a lot of the
Plus just consider those really simple substitution codes where
you make A = J, B = Z -- whatever random assignment. Also,
you want to parse your messages into 5 letter chunks: ALSOY
OUWAN TOPAR SEYOU RMESSA GESIN TO5LE TTERC HUNKS. You find
this simple "club house" codes in books for little kids, with
titles like 'I, Spy' and stuff. Of course this is nothing
sophisticated, but it's a great opportunity to use Python
string ops to: make the 5 letter uppercase chunks out of
whatever plaintext input (could be interactive and first,
then convert to file i/o); use the dictionary data structure
to do the lookup/substition.
>There are some *excellent* opportunities for assignments in there,
>too. And they're virtually impossible to cheat on :)
The basic strategy here is to make Python a fun "toy"
(in the sense that kids will want to pick it up and
play with it spontaneously, not because some teacher is
standing over them with a whip). The way to do this is
just provide enough interactive experience to suggest
a vocabulary of "tinker toys" (components), which kids
while then use in synergetic ways to assemble whatever.
What we want to avoid is the intimidating sense that
you're not allowed to start small. Too many educational
experiences include some older kids (e.g. teachers)
suggesting that your work is nothing special, not
interesting, because you don't know "all" of what's
to know about. Crypto is a case in point.
Regarding crypto, there are lots of segues to random
numbers (the Standard Library book re Python keeps
warning us that the randoms are "pseudo" and hence
potentially an Achilles heal if you're using them
as a basis for some encryption algorithm).
This whole concept of random numbers generated by
machines is especially rich, philosophically. We
have to be clear what we mean by "random" -- what
are the tests such numbers must pass? Knuth has
done a lot of work in this area, and computer science
has gotten a big boost from this thread -- which
thinking we can recapitulate in curriculum writing
geared for those relatively new to the subject.
I get into random numbers some in my "Random walks
through the matrix" piece, wherein a turtle swallows
an n-sided die and then hops in a spatial lattice
defined by n degrees of freedom at each turn to
play (the so-called isotropic vector matrix
features 12 spokes from every hub, to the
surrounding closest packed spheres at the corners
of a cuboctahedron).