11. Key Scheduling
Algorithm (KSA)
KSA
S
‣
byte
for i from 0 to 255
S[i]
S[1] := i
endfor
S
S[0]
,
,
Identity Permutation
‣
for i from 0 to 255
j := (j + S[i] + key[i mod keylength]) mod 256
swap S[i] and S[j]
Permute
S
Key
endfor
Faculty of Information Technology
Page
13. Pseudo-Random Generation
Algorithm (PRGA)
PRGA
pointer i
‣
‣
i
•
j
•
•
•
(S[i]
Faculty of Information Technology
S[i]
j
PRGA
S[i]
i := 0 , j := 0
S[j]
while
S[i]
S[j] :=GeneratingOutput:
i
(i + 1) mod 256
Keystream (j + S[i]) mod 256
j :=
swap S[i] and S[j]
S
+ S[j]) mod K := S[(S[i] + S[j]) mod 256]
256
output K
endwhile
Page
25. RSA Encryption
M
M<n
Public Key (e, n)
‣ Ciphertext C = Me mod n
RSA Decryption
ciphertext C
(d, n)
‣ Message
Private Key
M = Cd mod n
‣ p = 5, q = 7, n = 35, m = 24
Faculty of Information Technology
Page
25
26. n = 35, e = 5
Ciphertext = Me mod n
Plainte M
xt
L
12
Me
O
15
759375 15
V
22
E
5
515363 22
2
3125
10
Faculty of Information Technology
248832 17
Page
26
27. n = 35, d = 29
Cd
Cipher
text
17
15
22
M= Cd
mod n
Plainte
xt
481968572106750915091411 12
82522307000
127834039488589391112327 15
57568359400
L
8.5164331908653770195619
449972111e+38
22
V
5
E
10
Faculty of Information Technology
O
Page
27