Simple encryption proposal. Comments ?
phr-n2002b at NOSPAMnightsong.com
Thu Jan 2 15:58:20 CET 2003
bokr at oz.net (Bengt Richter) writes:
> Thanks for posting, mine was in C++ and not so pretty (though fast enough ;-)
> BTW, (untested)
> k1, k2, k3 = map(_inv_letters.__getitem__, x[i:i+3])
> might be an interesting alternative to the list comprehension?
I don't know, I wasn't really trying to make that function fast, I was
just playing around. Base52 is a clever idea (I've gotten burned a
number of times by non-alphanumeric base64 characters needing escaping
for some purpose) so I wanted to try it. A more serious
implementation should be done as a C patch to the binascii module.
I also sometimes use base 32 (5 bits per output character) which is
just monocase letters plus digits. The letters O and S, and the
digits 0 and 5, are omitted, since they're hard to tell apart from
each other in handwriting.
More information about the Python-list