Pseudo-random generation algorithm .28PRGA.29 RC4
the lookup stage of rc4. output byte selected looking values of s[i] , s[j], adding them modulo 256, , using sum index s; s(s[i] + s[j]) used byte of key stream, k.
for many iterations needed, prga modifies state , outputs byte of keystream. in each iteration, prga increments i, looks ith element of s, s[i], , adds j, exchanges values of s[i] , s[j], , uses sum s[i] + s[j] (modulo 256) index fetch third element of s, (the keystream value k below) bitwise exclusive or ed (xor ed) next byte of message produce next byte of either ciphertext or plaintext. each element of s swapped element @ least once every 256 iterations.
i := 0
j := 0
while generatingoutput:
:= (i + 1) mod 256
j := (j + s[i]) mod 256
swap values of s[i] , s[j]
k := s[(s[i] + s[j]) mod 256]
output k
endwhile
Comments
Post a Comment