Sabtu, 04 April 2015

Contoh Algoritma RSA

##########################################################################
Jika diketahui :
p = 3
q = 7

Penyelesaian :
n = p.q
   = 3 x 7
   = 21
m = (p-1) (q-1)
     = (3 -1)(7 – 1)
     = 12
e * d mod 12 = 1 (Cari bilangan prima yang jika mod M hasilnya 1)
e = 5
d = 17
public key = (e,n) = (5,21)
private key = (d,n) = (17,21)

S          I           S          J          A         R
83        73        83        74       65         82

##########################################################################


Proses Enkripsi dan Deskripsi
S = 83
Enkripsi
Deskripsi
C = M ^ e mod n
M = C ^  d mod n
8 ^ 5 mod 21 = 8
8 ^ 17 mod 21 = 8
3 ^ 5 mod 21 = 12
12 ^ 17 mod 21 = 3
 
I = 73
Enkripsi
Deskripsi
C = M ^ e mod n
M = C ^  d mod n
7 ^ 5 mod 21 = 7
7 ^ 17 mod 21 = 7
3 ^ 5 mod 21 = 12
12 ^ 17 mod 21 = 3


S = 83
Enkripsi
Deskripsi
C = M ^ e mod n
M = C ^  d mod n
8 ^ 5 mod 21 = 8
8 ^ 17 mod 21 = 8
3 ^ 5 mod 21 = 12
12 ^ 17 mod 21 = 3

J = 74
Enkripsi
Deskripsi
C = M ^ e mod n
M = C ^  d mod n
7 ^ 5 mod 21 = 7
7 ^ 17 mod 21 = 7
4 ^ 5 mod 21 = 16
16 ^ 17 mod 21 = 4

A = 64
Enkripsi
Deskripsi
C = M ^ e mod n
M = C ^  d mod n
6 ^ 5 mod 21 = 6
6 ^ 17 mod 21 = 6
4 ^ 5 mod 21 = 16
16 ^ 17 mod 21 = 4


R = 82

Enkripsi
Deskripsi
C = M ^ e mod n
M = C ^  d mod n
8 ^ 5 mod 21 = 8
8 ^ 17 mod 21 = 8
2 ^ 5 mod 21 = 11
11 ^ 17 mod 21 = 2

Tidak ada komentar: