The library allows addition, subtraction, multiplication, division, exponentiation, and inverses modulo an arbitrary number. It has the extended Euclid algorithm, and can convert between bases up to base 95.
It generates true prime numbers rather than probable primes.
For Internet Explorer on a 1.8 GHz WinXP machine, RSA-1024
takes 0.38 seconds to encrypt and 22 seconds to decrypt.
Generating the pair of 512-bit primes usually takes around 6 minutes, and is almost always under 10 minutes.
Generating a 256-bit prime takes about 14 seconds.
It's hard to imagine any practical use for this code, other than pedagogical.
JavaScript is obviously too slow
for most purposes. The language doesn't even
specify the size of integers, so the code has to
determine at runtime how many bits it can
store in each array element. This page was
just written for my entertainment, after seeing a
request for something like this on sci.crypt.