Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: cafter on February 22, 2023, 06:11:25 AM



Title: anyone can tell me what is this?
Post by: cafter on February 22, 2023, 06:11:25 AM
i found this from adam back's home page that says export crypto sig
the code is :
Code:
 -export-a-crypto-system-sig -RSA-3-lines-PERL

#!/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*',/((..)*)$/)


i not a coder or developer so asking this , what is meaning of export crypto sig
http://www.cypherspace.org/adam/rsa/


Title: Re: anyone can tell me what is this?
Post by: NotATether on February 22, 2023, 09:21:47 AM
Honestly I have no idea how to even run that as a program (let alone passing a sig file as an input to it). I'm getting a whole bunch of syntax errors when I pasted that into a perl file.


Title: Re: anyone can tell me what is this?
Post by: NotATether on February 22, 2023, 01:29:01 PM
Honestly I have no idea how to even run that as a program (let alone passing a sig file as an input to it). I'm getting a whole bunch of syntax errors when I pasted that into a perl file.

Me either, even after following the guide[1]. It's likely the problem lies within version of perl/dc.

[1] http://www.cypherspace.org/adam/rsa/rsa-details.html (http://www.cypherspace.org/adam/rsa/rsa-details.html)
[2] http://www.cypherspace.org/adam/rsa/story2.html (http://www.cypherspace.org/adam/rsa/story2.html), under big text "The commented version".

I'm not sure why an RSA encryption script would even need to use dc, because that is just a reverse polish calculator, and I know that Perl has its own set of arithmetic operators (not to mention that this doesn't even look like valid Perl).


Title: Re: anyone can tell me what is this?
Post by: HCP on February 22, 2023, 09:44:37 PM
i not a coder or developer so asking this , what is meaning of export crypto sig
http://www.cypherspace.org/adam/rsa/

It's a throwback to the "old days" (1990s) where the USA had a bunch of export restrictions on cryptographic algorithms and programs and suchlike as they were classified as "munitions". The idea was to create the smallest working version of the RSA algorithm that could be included in an email signature (or a signature on a Usenet newsgroup post etc) so it could be shared publicly with everyone.

People had T-Shirts printed with the text... and it looks like someone actually had it tattooed on their arm:
https://talkimg.com/images/2023/11/14/zt3i8.png


(not to mention that this doesn't even look like valid Perl).
Perl is great like that :P


Title: Re: anyone can tell me what is this?
Post by: serveria.com on February 23, 2023, 09:19:04 PM
i not a coder or developer so asking this , what is meaning of export crypto sig
http://www.cypherspace.org/adam/rsa/

It's a throwback to the "old days" (1990s) where the USA had a bunch of export restrictions on cryptographic algorithms and programs and suchlike as they were classified as "munitions". The idea was to create the smallest working version of the RSA algorithm that could be included in an email signature (or a signature on a Usenet newsgroup post etc) so it could be shared publicly with everyone.

People had T-Shirts printed with the text... and it looks like someone actually had it tattooed on their arm:
https://i.imgur.com/Z8cng6N.png


(not to mention that this doesn't even look like valid Perl).
Perl is great like that :P

Wow, thanks for clarifying, I could have never imagined something like this was possible and actually happened. I didn't know RSA algo was banned or under export restrictions in the 1990ies in the US.  :o


Title: Re: anyone can tell me what is this?
Post by: DaveF on February 24, 2023, 04:43:24 PM
Wow, thanks for clarifying, I could have never imagined something like this was possible and actually happened. I didn't know RSA algo was banned or under export restrictions in the 1990ies in the US.  :o

Lots of things like that in terms of encryption were and still are banned for export. From what I have seen it's really not something they go after you for, but if you are being charged with a bunch of other crimes that goes with it too.

When they started to craft the law things looked a lot different from the internet / tech world standpoint then when it passed, and the way the world is today it's totally pointless.

-Dave


Title: Re: anyone can tell me what is this?
Post by: tromp on February 24, 2023, 05:18:32 PM
i found this from adam back's home page that says export crypto sig
the code is :
Code:
 -export-a-crypto-system-sig -RSA-3-lines-PERL

#!/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*',/((..)*)$/)


i not a coder or developer so asking this , what is meaning of export crypto sig
http://www.cypherspace.org/adam/rsa/

The guide at http://www.cypherspace.org/adam/rsa/rsa-details.html works for me on my MacOS:

Code:
$ cat > rsa
#!/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*',/((..)*)$/)
$ wc rsa
       3       7     178 rsa
$ echo "squeamish ossifrage" | ./rsa -k=10001 -n=1967cb529 > msg.rsa
-i used with no filenames on the command line, reading from STDIN.
$ ./rsa -d -k=ac363601 -n=1967cb529 < msg.rsa
-i used with no filenames on the command line, reading from STDIN.
squeamish ossifrage
$

Should work just as well on any Linux system...
It encrypts the message by taking numbers modulo 6819722537 (1967cb529 in hex) to the power 65537 (10001 in hex), and decrypts by taking numbers modulo 6819722537 to the power 2889233921 (ac363601 in hex),
which gives back the original since 65537 * 2889233921 = 1 mod phi(6819722537).
Note that n=6819722537 is the product of two primes p=66593 and q=102409 and thus phi(n) = (p-1)*(q-1).
See https://en.wikipedia.org/wiki/RSA_(cryptosystem) for details.

The seemingly odd choice of plaintext is explained in

https://en.wikipedia.org/wiki/The_Magic_Words_are_Squeamish_Ossifrage


Title: Re: anyone can tell me what is this?
Post by: PowerGlove on July 07, 2023, 08:39:06 AM
IMO, it's worth reading Adam Back's post (with the original 5-line version), and Hal Finney's reply: http://www.cypherspace.org/adam/rsa/org-post.html (http://www.cypherspace.org/adam/rsa/org-post.html).

I think it says a lot about that era (and the concentration of talent on the Cypherpunks mailing list) that something like that was posted and within ~8.5 hours it was analyzed (cold), understood, and praised.