RSA Interactive Simulator : Encoding data with the public Key

RSA Interactive Simulator / Work Bench : Encoding data with the public Key

in encode_pup.php m is %s ",$m); If ( $n < 1 || $e < 1 || $d < 1 ) { printf("

Error, you have got to this page without defining all of the RSA keys

"); printf("

You must go back and generate a full RSA key

"); printf(""); } else { ?>

Here a user is encoding data to send to third party which has published a public key. The user takes the public key, and encodes the message. Only the third party can decode the message, using its private key

The encoding is simply performed by taking the number to be encrypted to the power of e, and then applying the modulus for n (i.e. p times q).

Encode Data using the following key set > > > >
Modulus (used by both public and private key)
e - the public key
m - the number to encrypt



DECODE : Decode with your secret key (n,d)


The decoding process calculates the value of c ^ d % n.

The value c ^ d ( ) in this case would produce a number with approx decimal digits !

Obviously this is unacceptable and would cause memory and processing time problems. Mathematical techniques for algebraically breaking this problem into smaller pieces, are described here

Note that for this very large value, the bc script may take up to minutes to finish this calculation.


De-code Data using the key set

Note that to encode with the private key, you may type a value in for 'c' and press decode. Cut and paste the 'in clear' value into the m of encode to verify correct reverse operation (de-coding with the private key ).

The purpose of encoding with the private key is one of verifying identity (i.e. anyone can decode it using your published public key, but it is stamped with your RSA identity)

> > >
Modulus (used by both public and private key)
d - the private key
c - the number to de-crypt
> > > > >