Chapter 3 Cryptography 47
Cryptography Overview
guess), an attacker would be able to determine some of the original message bytes by
XORing two sets of cipher bytes.
Figure 3-7 RC4 Encryption or Decryption

The RC4 algorithm with MAC

The RC4-with-MAC algorithm is an extension of the RC4 cipher. It provides data
integrity by using a Message Authentication Code (MAC) with the RC4 encryption
algorithm. The authentication code does not provide cryptographic authentication;
rather, it provides the equivalent of a checksum that can be used to determine if any
errors were introduced within the cipher bytes. The MAC guards against
transmission or retrieval errors, but it may not detect deliberate tampering with the
data.
Message Digests
A message digest (also sometimes referred to as a one-way hash function) is a fixed-
length computationally unique identifier corresponding to a set of data. That is, each
unit of data (for example, a file, a string, or a buffer) will map to a particular short
block, called a message digest. It is not random: digesting the same unit of data with
the same message digest algorithm will always produce the same short block.
A good message digest algorithm possesses the following qualities:
The algorithm accepts any input data length.
The algorithm produces a fixed length output for any input data.
Nth message
byte
Nth cipher
byte
XOR
Pseudo-
random
bytes
Key Key
Mixing