Encryption with Python

Peter Hansen peter at engcorp.com
Fri Jun 25 08:45:43 EDT 2004


Dennis Lee Bieber wrote:

> 	I wouldn't call the above an "encryption" function -- it looks
> to be nothing more than a substitution cipher. (I don't know how "cnt"
> is determined, but translate will, for any given invocation, return the
> same output character for any repeat occurrences of the input. A good
> encryption algorithm should not do that -- ideally, "bookkeeper" will
> encrypt with no repeated characters in the oo, kk, ee*e positions)

Kamilche *did* state clearly that it was "not secure, but it should
be enough to ward off casual hacking".

Also, if we're both using the same version of English, a substitution
cipher is still encryption, just a weak form.

See http://en.wikipedia.org/wiki/Cipher and related links, which point
out that even DES can be considered "from a sufficiently abstract
perspective", a substitution cipher on an enormously large binary
alphabet. ;-)

-Peter



More information about the Python-list mailing list