2 hours ago · Tech · 0 comments

When the US government classified strong encryption as “munitions,” RSA public key cryptography was technically illegal. In 1995, Adam Back protested this by creating a terse, obfuscated implementation of RSA in two lines of Perl code and used it as an email signature. The code was also printed on T-shirts. This was the code: #!/bin/perl -s-- -export-a-crypto-system-sig -RSA-3-lines-PERL $m=unpack(H.$w,$m."\0"x$w),$_=`echo "16do$w 2+4Oi0$d*-^1[d2%Sa 2/d0<X+d*La1=z\U$n%0]SX$k"[$m*]\EszlXx++p|dc`,s/^.|\W//g,print pack('H*',$_)while read(STDIN,$m,($w=2*$d-1+length$n&~1)/2) My initial intention was to unpack the code, explaining each piece in detail. I don’t have the time or patience to do that, and I imagine many readers do not either. For more of a blow-by-blow commentary, see this commentary from 1995. In the middle of the post is echo ... | dc This is the most dense and most important part of the code. Perl calls the dc calculator to do the arbitrary precision arithmetic that RSA…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.