Question: El-gamal Cryptography Algorithm
0

EI- Gamal Cryptography

  • EI gamal cryptography works in 3 steps/stages

$\hspace{1.5cm}$a. Key generation

$\hspace{1.5cm}$b. EI gamal encryption

$\hspace{1.5cm}$c. EI gamal decryption

A. EI gamal key generation:

  1. Select a large prime number ‘P’

  2. Select encryption key $‘E_1’$

  3. Select decryption key ‘D’

  4. Select encryption key $‘E_2’$ such that

$\hspace{1.5cm}E_2 = E_1 mod P$

  1. Form the set $(E_1, E_2, P) and D$

B. EI gamal key encryption:

  1. Select a random number ‘r’

  2. Compute the first part of ciphertext $‘C_1’ , C_1 = E_1^r mod P$

  3. Compute the second part of ciphertext $‘C_2’ , C_2 = (E_1^r * PT) mod P$

C. EI gamal key decryption:

  1. Calculate the PT

$\hspace{1.5cm}PT = (C_2 * (C_1^{D-1} )) mod P$

$\hspace{1.5cm}$Eg let PT = &

$\hspace{1.5cm}E_1 = 2$

$\hspace{1.5cm}$D = 3

$\hspace{1.5cm}$Random no = 4

  1. Key generation:

$\hspace{1.5cm}$P= 11. E = 2. D =3

$\hspace{1.5cm}E_2 = E_1^D mod P$

$\hspace{1.5cm}= 2^3 mod 11$

$\hspace{1.5cm}$= 8 mod 11

$\hspace{1.5cm}$= 8

  1. Encryption:

$\hspace{1.5cm}$Random no r = 4

$\hspace{1.5cm}C_1 = E_1^r mod P$

$\hspace{1.5cm}= 2^4 mod 11$

$\hspace{1.5cm}$= 16 mod 11

$\hspace{1.5cm}$= 5

  1. $C_2 =Pt * E_2^r mod P$

    $\hspace{1.5cm}= 7 * 8^4 mod 11$

    $\hspace{1.5cm}$= 28672 mod 11

    $\hspace{1.5cm}$= 6

  2. Decryption:

$\hspace{1.5cm}PT = (C_2 * (C_1^{D-1} )) mod P$

$\hspace{1.5cm}= (6*5^{3-1}) mod 11$

$\hspace{1.5cm}$= 15- mod 11

$\hspace{1.5cm}$= 7

it cns • 245 views
ADD COMMENTlink
written 4 months ago by gravatar for Swati Sharma Swati Sharma ♦♦ 0
Please log in to add an answer.