Simple encryption proposal. Comments ?

Paul Rubin phr-n2002b at NOSPAMnightsong.com
Sun Dec 29 21:36:10 EST 2002


"Thomas Weholt" <2002 at weholt.org> writes:
> I've come up with a very simple One-Time-Pad encryption scheme, inspired by
> the book "Applied Cryptography" by Bruce Schneier, page 15, Chapter 1.
> It takes each letter in the alphabet and swaps it with a different random
> letter from a different set of letters, building a dictionary of
> letter->swap-letter
> to base encryption on. I didn't excactly read the text very good and did the
> coding after memory so there might be huge logic wholes in the thing.
> 
> Anyway, if somebody has any comments on this way of encryption, tips for
> improvements etc. I'd be happy to hear it. Code follows:

Don't quit your day job ;-).  A true OTP is generated from a real
physical source of randomness, like timing the intervals between
clicks of a geiger counter.  A cipher based on a PRNG is called a
stream cipher.

You've suggested using whrandom as a keystream generator for a stream
cipher.  That's a really poor idea.  whrandom makes no serious attempt
to stand up to cryptanalysis.

If you want a simple but strong encrpytion function, try this one:

  http://www.nightsong.com/phr/crypto/p2.py

I never did get to making a real release of that (I will try to do so
soon) so you'll have to disable the date check.  Please don't
distribute copies with the time check removed though.  The real
release will probably be called p3 and have some cosmetic changes in
the code.

Paul



More information about the Python-list mailing list