In: Computer Science
Question Asked :
Requirement Given: Just Implement Crypto Algorithm.
Answer:
There are many Crypto Algorithms like Diffie Hellman,RSA,Cramer Shoup Crypto System,Elgamal Encryption Etc.
I have Implemented RSA Crypto Algorithm(Rivest Shamir Adleman) :
Example of RSA Functiniong:
Step 1: For Suppose Consider P=17, Q=11
Step 2: N=PQ=17*11=187
Step 3: Function of N f(N): (P-1)*(Q-1) =16*10=160
Step 4: gcd(e,160)=1 choose e=7; (According to Question to be taken)
Step 5: D: de= 1mod160 and D<160 Value is D =23 since 23*7=161=10*160+1
Step 6: Public Key KU=7 and 187
Step 7: Private Key: 23 and 187
Step 8: Encryption
C=88 Mod 187=11
Step 9: Decryption
M= 1123 Mod 187 =88.
The Above Example is Explained and Elaborated Step By Step . Looks tough for First Time ,Revise it again to make your understanding Clear.
Tip: Directly Go through Encryption and Decryption (Step 8 and Step 9) which is enough to Understand RSA Algorithm .
I have written RSA Algorithm Code in Java Language for You (Implemented in Eclipse IDE)
For Running of Codes import these Lines of Code:
import java.util.*;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.Signature;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
Proof of Implementation of RSA Algorithm in JAVA:
In the Comment Lines I have mentioned the Procedure of the Code in which it is implemented.
Thank You