Block and Stream Ciphers
Block and Stream Ciphers
The literature divides the symmetric ciphers into two broad categories: stream ciphers and
block ciphers. Although the definitions are normally applied to modern ciphers, this
categorization also applies to traditional ciphers.
Call the plaintext stream P, the ciphertext stream C, and the key stream K.
Example 3.30
Additive ciphers can be categorized as stream ciphers in which the key
stream is the repeated value of the key. In other words, the key
stream is considered as a predetermined stream of keys or
K = (k, k, …, k). In this cipher, however, each character in the
ciphertext depends only on the corresponding character in the
plaintext, because the key stream is generated independently.
Example 3.31
The monoalphabetic substitution ciphers discussed in this chapter are
also stream ciphers. However, each value of the key stream in this
case is the mapping of the current plaintext character to the
corresponding ciphertext character in the mapping table.
Cryptography & Network Security - Behrouz
61
A. Forouzan
3.4.1 Continued
Example 3.32
Vigenere ciphers are also stream ciphers according to the definition.
In this case, the key stream is a repetition of m values, where m is the
size of the keyword. In other words,
Example 3.33
We can establish a criterion to divide stream ciphers based on their
key streams. We can say that a stream cipher is a monoalphabetic
cipher if the value of ki does not depend on the position of the
plaintext character in the plaintext stream; otherwise, the cipher is
polyalphabetic.
Cryptography & Network Security - Behrouz
62
A. Forouzan
3.4.1 Continued
Example 3.33 (Continued)
In a block cipher, a group of plaintext symbols of size m (m > 1) are encrypted together
creating a group of ciphertext of the same size. A single key is used to encrypt the whole
block even if the key is made of multiple values. Figure 3.27 shows the concept of a block
cipher.
Example 3.34
Playfair ciphers are block ciphers. The size of the block is m = 2. Two
characters are encrypted together.
Example 3.35
Hill ciphers are block ciphers. A block of plaintext, of size 2 or more is
encrypted together using a single key (a matrix). In these ciphers, the
value of each character in the ciphertext depends on
all the values of the characters in the plaintext. Although the key is
made of m × m values, it is considered as a single key.
Example 3.36
From the definition of the block cipher, it is clear that every block
cipher is a polyalphabetic cipher because each character in a
ciphertext block dependsCryptography
on all&characters in the plaintext block. 65
Network Security - Behrouz
A. Forouzan
3.4.3 Combination
In practice, blocks of plaintext are encrypted individually, but they use a stream of keys to
encrypt the whole message block by block. In other words, the cipher is a block cipher when
looking at the individual blocks, but it is a stream cipher when looking at the whole message
considering each block as a single unit.