titivillus has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to make a perl script that does RSA using trivially small primes (I'm specifically using the primes Bruce Schneier uses in his example in Applied Cryptography) in order to keep the problem down to a point where it fits (more or less) in the human brain. The problem is, in the code I'm doing, I'm ending up having to find ( 1019**1019 ) % 3337, and 1019**1019 blows the top off perl's default integer implementation (1019**103 pretty much gets you infinity) so getting the mod of infinity is a no-goer.
I've looked into Math::BigInt, but it has no exponentiation according to my work Perl docset. I realize that 1000**1019 is essentially 1 followed by 3069 zeroes, but I'm not seeing a clever way of handling this. I'd prefer pure perl solutions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The Exponentiation of (not-so) Large Primes
by Abigail-II (Bishop) on Oct 02, 2002 at 16:03 UTC | |
|
Re: The Exponentiation of (not-so) Large Primes
by hiseldl (Priest) on Oct 02, 2002 at 14:42 UTC | |
|
Re: The Exponentiation of (not-so) Large Primes
by abell (Chaplain) on Oct 02, 2002 at 16:51 UTC | |
|
Re: The Exponentiation of (not-so) Large Primes
by BrowserUk (Patriarch) on Oct 02, 2002 at 15:18 UTC | |
|
Re: The Exponentiation of (not-so) Large Primes
by hsmyers (Canon) on Oct 02, 2002 at 19:54 UTC | |
by titivillus (Scribe) on Jun 29, 2006 at 04:55 UTC | |
by hsmyers (Canon) on Jun 29, 2006 at 15:25 UTC | |
|
Re: The Exponentiation of (not-so) Large Primes
by thor (Priest) on Oct 02, 2002 at 23:01 UTC |