rsa-details.html
aefce94f6c643ab9baa5098e1db54c64251bbcc1ba18e00a239b52951539c789
<HTML>
<HEAD>
<TITLE>export-a-crypto-system sig</TITLE>
</HEAD>
<BODY BGCOLOR="#000000" TEXT="#FFFFFF" LINK="#00FFFF" VLINK="#FFFF00" ALINK="#FF00FF">
<H1>export-a-crypto-system-sig</H1>
This is a perl program which implements RSA encryption and decryption,
and is small enough to use as a
<A HREF="perl-rsa-sig.html">signature file</A>:
<HR>
<XMP>
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)
</XMP>
<HR>
<H2>Software required, compatibility</H2>
To use you will need <A HREF="http://www.perl.com">perl</A>,
and <A HREF="dc.html">dc</A>.
<P>
Some older versions of dc don't work, if you have problems with larger
keys try getting
<A HREF="dc.html">GNU dc</A>. If you have a SUN you will need GNU dc
as the versions of dc distributed with SUN O/S, and Solaris don't seem
to work.
<H2>Using</H2>
To test, save it as "rsa" then try:
<PRE>
% chmod 700 rsa
% echo "squeamish ossifrage" | rsa -k=10001 -n=1967cb529 > msg.rsa
% rsa -d -k=ac363601 -n=1967cb529 < msg.rsa
</PRE>
Here are few keys to try it out with, while its not as fast as
<A HREF="http://www.ifi.uio.no/~staalesc/PGP/">PGP</A> it has usable
performance even for large keys
<H3>8bits:</H3>
<PRE>
e=11
d=ac1
n=ca1
</PRE>
<H3>32 bits:</H3>
<PRE>
e=10001
d=ac363601
n=1967cb529
</PRE>
<H3>128 bits:</H3>
<PRE>
e=10001
d=135b03530e94874283f0f0000ffff0001
n=24000c6c9620886831124848640044901
</PRE>
<H3>512 bits:</H3>
<PRE>
e=10001
d=62a03c0df0b96335047a12923a7d20bc2b7bb07c59aba2c4b094fc7d54392e8a2e7606cb
5d574407640f4bb4e0ea6aeb7fff0000ffff0000ffff0000ffff0001
n=12004001208404a43f00502200b204602600c00001da894922433e4601a2c85024024001
418004602404240109301008140000000142404002010000000000001
</PRE>
It is possible to use this program with your PGP keys, heres my PGP
public key expressed as hex numbers suitable for perl-rsa (and heres a
perl program to <A HREF="pgpacket.html">
extract your PGP public keys</A>), send me some RSA encrypted mail!
<H3>1024 bits:</H3>
<PRE>
e = 13
d = (with-held for obvious reasons)
n = b487306fc179f3bd5e55a9e7c5737722dc97ec4326838b67de814638214988cd90416f
f55fee783c32aacc55f2b90c073c69344f5a4d9a6fb3f90770ffe6a78084bbae3f2c77fe14
b70e0db894b063e01f91e169591ec2b5da7bf2a0427b7bd77bfa97129e9cfe10768b919f05
728e7484949bf29de83b6a9fe7f36ea2de58b5
</PRE>
Send me some mail by doing:
<PRE>
% rsa -k=[e] -n=[n] | uuencode "filename" | mail -s "subject" aba@dcs.ex.ac.uk
</PRE>
ie, cut and paste this into your unix shell:
<PRE>
rsa -k=13 -n=b487306fc179f3bd5e55a9e7c5737722dc97ec4326838b67de814638214988cd
90416ff55fee783c32aacc55f2b90c073c69344f5a4d9a6fb3f90770ffe6a78084bbae3f2c
77fe14b70e0db894b063e01f91e169591ec2b5da7bf2a0427b7bd77bfa97129e9cfe10768b
919f05728e7484949bf29de83b6a9fe7f36ea2de58b5 |
uuencode "perl-rsa-mail" | mail -s "rsa mail" aba@dcs.ex.ac.uk
</PRE>
Then type the body of your message, and press ^D TWICE when you have
finished composing your message.
Heres my <A HREF="/~aba/pgp-key.html">PGP public key</A>
in more conventional PGP format.
<P>
If you know perl or dc and can see any way to shorten the code please
tell me, I'd really like to reduce its size as much as possible,
heres the <A HREF="story.html">story at the moment</A>.
<HR>
<EM>
Comments, html bugs to me
(<A HREF="http://www.dcs.ex.ac.uk/~aba/">Adam Back</A>) at
<A HREF="mailto:aba@dcs.ex.ac.uk"><aba@dcs.ex.ac.uk></A>
</EM>
</BODY>
</HTML>