Introduction
History
How it Works
Applications
Key Verification
Future
See Also
Those Involved
Bibliography
Glossary
References
Group Members
To Do
Encrypt Data
Q & A
Search:  

Public Key Encryption


Encrypt Data

Below is an applet that can convert a message, of your choosing, into an RSA encoded string and then decode that string. It should guide you through the algorithm for RSA encryption in an interactive manner. ( For a copy of the Java code Click Here)

 

Notes:

1. The message can be split-up into its component characters and the hash value can be obtained from each of these characters (ASCII requires 256 hash values). A number X can only be encoded by a public key with a value greater than X. Therefore the public key must be bigger than 256. In practical terms this means that values chosen for P and Q should be approximately greater than 1000 (error checking variables need to be encoded too).

2. Finding the private key (d) can be a difficult task as the algorithm used to calculate this key is a not particularly good. On some occasions, the private key will be extremely hard to find (depending on the p and q values) and there is a chance that the program will loop for some time. This is however a problem in all encryption programs and so it is useful to illustrate it here. Try inputting values very close to each-other and see how long it takes

3. The program will check to see if the values you have selected for P and Q are prime numbers, as this is vital for the algorithm to work. If they are not prime numbers they will be replaced with the prime number which comes directly after the number selected.

4. The source code for the applet is available for download. It is, at present, un-commented but this may change if I have the time.

5. Both p and q should be different prime numbers, if they are the same the applet will crash.

Split-up

If the private key where 1024bits, it would be wasteful to encode every character of the message as a 1024bit number. Therefore the encoding algorithm, encodes the hash values of multiple characters in one pass. I.e. The 1024bit number contains the hash value of 128 bytes.

X greater than N

	N=P*Q

	Example:
		X 	= 	5;
		N	=	3;

	If we try and encode X with N using a simplified formula X mod N we get:
	5 mod 3 = 2