RSA is one of the first practicable public-key cryptosystems. In such a cryptosystem, the encryption key is public and differs from the decryption key which is kept secret. In RSA, this asymmetry is based on the practical difficulty of factoring the product of two large prime numbers.

In this example, the Crunch arbitrary percision arithmetic library is used to generate an RSA key-pair, and uses it to "encrypt" and "decrypt" data.

The calculations on this page are executed sequentially. Because Crunch is web-worker enabled, some of the above operations could be parallelized for even better performance.

All numbers on this page are represented by byte-arrays which represent arbitrary-precision integers.