summaryrefslogtreecommitdiff
path: root/3544/CH4/EX4.5.2/Ex4_5_2.sce
blob: 8642b7a41facd9e6f4cbbf567c63ea902538df9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13

//ElGamal Key Encryption

r = 4 
pt = 7
e1 = 2
e2 = modulo(e1^d,p)

c1 = modulo(e1^r,p)
c2 = modulo(pt*e2^r,p)

disp("Cipher text")
printf("(%d,%d)",c1,c2)