Message Integrity
While encryption provides privacy, message integrity ensures the recipient that the message was not tampered with during transit. While encryption as it is used in Kerberos gives you message integrity for “free,” since only the two end points have the required key to encrypt and decrypt messages, there are specialized message-integrity algorithms that can ensure message integrity without the overhead of encryption. You will see message-integrity algorithms referred to as one-way hashes, or just hashes.
Hashes work as mathematical one-way functions. They take an input message that is arbitrarily long, run it through a mathematical algorithm, and output a fixed size (typically 64-256 bits) message that represents the input. The idea behind the hash function is that while it is easy to calculate the hash output for a given input, it is mathematically hard to go the opposite way and derive an input that produces the same output, hence their “one-way” nature.
A trivial example of a hash function is to add all of the byte values of a message together, and take the sum modulus a maximum number—say, 1024. It is not possible to reconstruct the original input stream from this sum. Another property of a hash algorithm is its cryptographic strength, or the ability for attackers to craft input designed to produce a given hash value. Since the hash value (in this case, the sum of the bytes of the message mod 1024) contains less data than the input stream (this simple example only ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access