pgp-in-50-lines-of-perl? (Re: The Pure Crypto Project's Hash Function)

Adam Back adam at cypherspace.org
Sun May 4 14:08:18 EDT 2003


On Sun, May 04, 2003 at 01:24:02AM -0700, Bill Stewart wrote:
> Back when we were having fun doing minimum-length crypto implementations
> http://www.cypherspace.org/~adam/rsa/  like RSA-in-minus-3-lines-of-perl,
> suitable for T-shirts and tattoos and coke cans and email signatures,
> it was probably possible to put together a one-page cryptosystem
> implementing PGP-like functionality (but not compatibility, of course),
> capable of being faxed to anybody.

Actually I did at one point implement a PGP compatible signature
verifier using MD5 in 5 lines of perl, and RSA in perl/dc.

> The most likely function to be difficult was the prime number
> generation routine; everything else is known small (except of course
> for perl itself :-)

There is also a RSA key generator (including prime generation) by
Steve Reid in 13 lines.  I guess you could probably get a basic PGP
compatible implementation of encryptions, signature and keygen in one
page of perl/dc etc. ie 60 lines perhaps less.  I mean we have RSA in
2 lines, md5 in 8 lines, key gen in 13 lines; you'd need IDEA which no
one has implemented in compacted perl, but we have
2+8+13+IDEA+formatting IDEA has no s-boxes or magic values or
anything, so could probably be quite compact and perl is good at
formatting.

Putting it together is an exercise for the reader with entirely too
much time on his hands :-)

Adam

---------------------------------------------------------------------
The Cryptography Mailing List
Unsubscribe by sending "unsubscribe cryptography" to majordomo at metzdowd.com



More information about the cryptography mailing list