Cryptography Reference
In-Depth Information
You first type a plaintext message in the plaintext area, then click a button to encipher.
Clicking this button again regains the plaintext. If you encipher again, you will see that an
entirely different ciphertext is generated. This is, of course, because salt is used.
Take note of the block sizes with Rabin; that is, the ciphertext block size is one byte
greater than the plaintext block size. Why? This is easy to see if you recall that the message
(as an integer) in a block must be less than the modulus. Suppose, for example, that the
modulus (as a binary integer) is 26 bits long. We would then choose the plaintext block size
as the largest byte smaller than 26 bits, or 3 bytes. However, once the encryption takes place
on this block, it may produce a number as long as 26 bits (certainly greater than 3 bytes) in
length; thus, the ciphertext block size needs to be one byte greater than the plaintext block
size, or in this case, 4 bytes.
Static Ciphers The Rabin cipher, like many other block ciphers, has a weakness in that
it always maps the same plaintext to the same ciphertext. We call these ciphers memoryless,
or static. Common plaintext in these cryptosystems can expose itself by appearing often
(encrypted) in the ciphertext. When a block cipher is being used in this way, we say it is run-
ning in electronic code book, or ECB, mode.
A solution to this is to modify these ciphers so that a particular plaintext maps to differ-
ent ciphertexts, usually depending on its position in the data. When a cipher is modified to
behave this way, it is called a stream cipher. There are many ways to do this; the standard
method for public key ciphers is called chaining.
10.5
CIPHER BLOCK CHAINING (CBC)
Cipher block chaining refers to a method of enhancing block enciphering. It employs a
mask using exclusive-or at the bit level. You should be familiar with how an exclusive-or
works, but we will review it here in Table 10.1. Suppose
x
and
y
are bits, and we represent
the exclusive-or operation with the symbol
.
One should note that the
operation is commutative, and reversible, in the sense that if
x
,
y
, and
z
are bits, then
z = x y iff x = y z iff y = x z .
E XAMPLE .
Suppose
x
= 0, and
y
= 1. Then
z
=
x y
= 0
1 = 1. We can recover
x
by tak-
ing
z y
= 1
1 = 0 =
x
. It should be clear to you that this is possible no matter what val-
ues are used for
. For completeness, all possible values are in the Table 10.2; note
that the appropriate columns match.
x
and
y
TABLE 10.1
x
y
x y
0
0
0
0
1
1
1
0
1
1
1
0
 
Search WWH ::




Custom Search