0% found this document useful (0 votes)
9 views

Elgamal Encryption Algorithm

Uploaded by

bcs07183008
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Elgamal Encryption Algorithm

Uploaded by

bcs07183008
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Elgamal Encryption Algorithm

Public key encryption scheme


1. Elgamal key Generation
2. Elgamal key encryption
3. Elgamal key Decryption

13.
2
Elgamal key Generation
Step 1: large prime no
 let p=11
Step2:Public key e1=2
Step 3: private key d=3
Step4:compute e2=?

13.
3
 e2=e1^d mod P
 e2=2^3mod 11
 e2=8mod11
 e2= 8/11=0.72727-0=0.72727*11=8
 e2=8
 public key(e1,e2,p)
 (2,8,11)
 private key d=3

13.
4
Elgamal key Encryption:
Step 1:random integer R=4
Step2:Compute C1
 c1=e1^R mod p
 c1=2^4 mod 11
 c1=5
Step3: compute C2

13.
5
M=7
 c2=(e2^R*M)mod p
 c2= (8^4*7) mod 11
 c2=(4096*7) mod 11
 c2=28672 mod 11
 c2=6
 Final cipher(c1,c2)
 (5,6)

13.
6
Elgamal key Decryption:
 M=[c2*(c1^d)^-1] mod p
 7=[ 6*(5^3)^-1] mod 11
 7= [6*(125)^-1] mod 11
 Find Inverse 125^-1
 125*x mod11=1
 125*3 mod 11=1
 375/11=34.0909091-
34=0.0909091*11=1

13.
7
M=[c2*(c1^d)-1] mod p
7=[6*3] mod 11
7= 18mod 11
7= 18/11=1.63636364-1=0.63636364*11
7=7

13.
8
P=17
 e1=6
 e2=?
 d=5
 M=13
 R=10

13.
9
Key Gen:

 e2= e1^d mod p


 e2=6^5 mod 17
 e2= 7
 Public key e1,e2 (6,7)
 Private key d=5

13.
10
Key Encryption:
 R=10
 C1=e1^Rmod P
 c1= 6^10 mod 17
 c1=15
 c2=(e2^R *M) mod P
 c2=( 7^10 *13)mod 17
 c2=282475249*13 mod 17
 c2=3672178237 mod 17

13.
11
c2=3672178237 mod 17
C2= 9
 C1,C2 (15,9)

13.
12
Decryption Key
M=[c2*(c1^d)-1] mod 17
13= [9*(15^5)-1] mod 17
13= [9 *(759,375^-1 )mod 17
Find inverse:
 759375*x mod 17=1
 759375*9 mod 17=1
13= [9*9]mod 17
13 =81mod 17=81/17=4.76470588-
4=0.76470588*17=13

13.
13
13 =81mod 17=81/17=4.76470588-
4=0.76470588*17=13
13=13

13.
14
P=283
 e1=60
 e2=?
 d=7
 M=101
 R=36

13.
15
 e2= e1 ^d mod P
 e2= 60^7 mod 283
 e2= 216
 e1,e2( 60,216)= Public keys
 d= 7= Private key

13.
16
 R=10
 C1=e1^R mod P
 c1= 60^36mod 283
 c1=78

 c2= e2^R*M mod p


 c2= 216^36 *101 mod 283
 C2=218

13.
17
 c1,c2 = (78,218)
 M=[ c2*(c1^d)^-1] mod P
 101= [ 218 *(78^7)-1] mod 283
 101= [ 218*116] mod 283
 101= 101

13.
18

You might also like