Simple encryption proposal. Comments ?

Anthony Baxter anthony at interlink.com.au
Tue Dec 31 00:28:48 EST 2002


>>> "Thomas Weholt" wrote
> 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.

Perhaps you should read Applied Cryptography more closely. You're not
creating a one-time-pad here.

>     def generatePad(self):
>         self.pad_in = {}
>         self.pad_out = {}
> 
>         while self.UPPER:
>             c = self.UPPER.pop()
>             d = self.LOWER[whrandom.randint(0, len(self.LOWER)-1)]
>             self.LOWER.remove(d)
>             self.pad_in[c.lower()] = d
>             self.pad_out[d] = c.lower()

I've only got the first edition here at home with me, but, from the
bottom of page 14, continuing on to page 15:

    The caveat, and this is a big one, is that the key letters have to be
  generated randomly. [ snip ] 
    Using a pseudo-random number generator doesn't count.
    ----- - ------------- ------ --------- ------- -----

If you read Bruce's monthly 'Crypto-Gram' newsletter, most months he'll 
have a 'Doghouse' section, with bogus crypto products. A suprising number
or them are bogus not-really-a-one-time-pad.

You're not even trying to generate a decent random seed, for god's sake!

This isn't a one-time pad. If you use this in an application where you
care about the security (and, conversely, someone else cares about 
breaking the security) you're a danger to yourself and a hazard to others. :)

Anthony




More information about the Python-list mailing list