[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Message Digest Ciphers (was Re: rc2 export limits..)

P J Ponder writes:
>  How can I use SHA to encrypt something for someone else to
>  decrypt?  I know how to use it for authentication; am I missing
>  something here?

Check Applied Cryptography for info on ciphers such as "Karn",  
"Luby-Rackoff", and "MDC" ...  These are encryption algorithms that use  
one-way hashes as their block functions.

Attached is a version of the Karn cipher I implemented as an  
export-a-crypt-system .sig a while back...  I used python because it's my  
favorite language and has MD5 built-in.  I implemented the Karn cipher since  
it was the simplest (and therefore shortest) of the MD ciphers, not because  
it's the most secure.


#!/usr/local/bin/python -- -export-a-crypt-system MD5 CBC-mode Karn Cipher
from md5 import *;from sys import *;from string import *;M=md5;il=ir=M(argv[3]\
=l'};main="def x(a,b):return joinfields(map(lambda m,n:chr(m^n),map(lambda m:o\
rd(m),a),map(lambda m:ord(m),b)),'');\nwhile(p):p=ljust(p,32);l,r=p[:16],p[16:\
#try: echo 'TESTING 1 2 3' | karn -e 'key' 'I-V' | karn -d 'key' 'I-V'