Cryptography Reference
In-Depth Information
KeyExpansion (key
,
Nk)
1: for i
=
0to Nk
1 do
2:
w i
key i
3: end for
4: for i
=
Nk to 4
×
(Nr
+
1)
1 do
5:
t
w i 1
6:
if i mod Nk
=
0 then
7:
replace [ t 0 ,
t 1 ,
t 2 ,
t 3 ]by[ t 1 ,
t 2 ,
t 3 ,
t 0 ]in t
8:
apply S-box to the four bytes of t
XOR x i / Nk 1 (raise the polynomial x to the power i
9:
/
Nk
1
in GF(2 8 )) to the first byte of t
=
=
10:
4 then
11: apply S-box to the four bytes of t
12: end if
13: w i
else if Nk
8 and i mod Nk
w i Nk
t
14: end for
2.8
Stream Ciphers
2.8.1
Stream Ciphers versus Block Ciphers
All conventional encryption schemes that we have seen so far are block ciphers in the
sense that they encrypt blocks of plaintexts. They are often opposed to stream ciphers
which encrypt streams of plaintext on the fly. A stream cipher often encrypts streams of
plaintext bits, or streams of plaintext bytes. This distinction is often misleading since
block ciphers are used as well in a mode of operation so that they can encrypt streams
of blocks. Nevertheless, we will call block cipher an encryption scheme in which the
underlying primitive is defined on a large finite set (of “blocks”) which cannot be
enumerated exhaustively in practice. With this definition we cannot assimilate a bit or
a byte to a block. Conversely, we call stream cipher an encryption scheme which can
encrypt streams of information in a smaller finite set.
First of all we notice that we can transform a pseudorandom generator into a stream
cipher. Stream ciphers are indeed often defined by a key-stream generator which is used
as a one-time pad: instead of having a large random key for the Vernam cipher, we use
a pseudorandom key which is generated as a key-stream.
We also notice that we can transform a block cipher into a stream cipher by using
the CFB, or CTR mode, with a small parameter
9 (see Sections 2.2.3, 2.2.4, and 2.2.5).
2.8.2 RC4
RC4 is an encryption algorithm which was designed in 1987 by Ronald Rivest at MIT.
It was kept as a commercial secret until it was disclosed in 1994. In particular there is no
9
It is not recommended to do the same for OFB.
Search WWH ::




Custom Search