RSA in Javascript

RSA Calculator Tool




$p$
$q$
large random primes
$p \neq q$
   
 
$\downarrow$


RSA modulus
$n = p \times q$
 
 
$\downarrow$


totient
$\phi(n) = (p-1)(q-1)$

 
$\downarrow$


$1 < e < \phi(n)$
$e$ coprime with $\phi(n)$

 
$\downarrow$


$1 < d < \phi$
$ed \equiv 1$ $mod$ $\phi$



 
$\Delta t = $
 
$c \equiv m^e \ (mod \ n)$


 
$\Delta t = $
 
$m \equiv c^d \ (mod \ n)$


Notes: $p$ and $q$ must not be equal. The message number must be strictly less than $(n-1)$.
Using large primes will result in large values for the exponent $d$. Values of $d > 10^6$ are going to take forever to decrypt, but if you wait long enough it should eventually complete.
Using large primes won't work on all browsers because of the larger-than-usual memory allocation requirement. Chrome works best; Chrome doesn't care how much memory you ask for.
Here are some primes you can try for testing.