Department of Information Science & Engineering
CRYPTOGRAPHY AND NETWORK SECURITY
IS62214IC
By
Prof. Prajna U R
Assistant Professor
Department of Information Science & Engineering
Sahyadri College of Engineering and Management, Adyar Mangaluru
Email:
[email protected] Mob:8495971075
MODULE-4
Cryptographic Data integrity algorithms
Topics to be covered
Cryptographic Hash functions - applications, Message Authentication – Requirements and Functions.
What is Hash function?
• A hash function H accepts a variable-length block of data M as input
and produces a fixed-size hash value
h = H(M)
The kind of hash function needed for security applications is referred to
as a cryptographic hash function
Cryptographic hash function;
h=H(M)
Properties of Hash function
• A “good” hash function has the property that the results of applying
the function to a large set of inputs will produce outputs that are
evenly distributed and apparently random.
• The principal object of a hash function is data integrity. A change to
any bit or bits in M results, with high probability, in a change to the
hash code.
Properties of cryptographic hash
function
• A cryptographic hash function is an algorithm for which it is
computationally infeasible (because no attack is significantly more
efficient than brute force) to find either
• a) a data object that maps to a pre-specified hash result (the one-way
property)
• b) two data objects that map to the same hash result (the collision-
free property).
• Because of these characteristics, hash functions are often used to
determine whether or not data has changed.
Message Authentication
• Message authentication is a mechanism or service used to verify the
integrity of a message.
• Message authentication assures that data received are exactly as sent
(i.e., there is no modification, insertion, deletion, or replay).
• When a hash function is used to provide message authentication, the
hash function value is often referred to as a message digest.
Essence of the use of a hash function for message integrity
• The sender computes a hash value as a function of the bits in the
message and transmits both the hash value and the message.
• The receiver performs the same hash calculation on the message bits
and compares this value with the incoming hash value.
• If there is a mismatch, the receiver knows that the message (or
possibly the hash value) has been altered (Figure a).
• The hash value must be transmitted in a secure fashion. That is, the
hash value must be protected so that if an adversary alters or replaces
the message, it is not feasible for adversary to also alter the hash
value to fool the receiver. This type of attack is shown in Figure b.
Simplified Examples of the Use of a Hash Function for
Message Authentication
• Method-1 :
The message plus concatenated hash code is encrypted using symmetric encryption.
Because only A and B share the secret key, the message must have come from A and has
not been altered. The hash code provides the structure or redundancy required to achieve
authentication. Because encryption is applied to the entire message plus hash code,
confidentiality is also provided.
Method-2
• b. Only the hash code is encrypted, using symmetric encryption. This
reduces the processing burden for those applications that do not
require confidentiality.
Method-3
• c. It is possible to use a hash function but no encryption for message
authentication. The technique assumes that the two communicating
parties share a common secret value S. A computes the hash value over
the concatenation of M and S and appends the resulting hash value to M.
Because B possesses S, it can recompute the hash value to verify. Because
the secret value itself is not sent, an opponent cannot modify an
intercepted message and cannot generate a false message.
Method-4
• Confidentiality can be added to the approach of method (c) by
encrypting the entire message plus the hash code.
• More commonly, message authentication is achieved using a message
authentication code (MAC), also known as a keyed hash function.
• Typically, MACs are used between two parties that share a secret key
to authenticate information exchanged between those parties.
• A MAC function takes as input a secret key and a data block and
produces a hash value, referred to as the MAC, which is associated
with the protected message.
• If the integrity of the message needs to be checked, the MAC function
can be applied to the message and the result compared with the
associated MAC value.
• An attacker who alters the message will be unable to alter the
associated MAC value without knowledge of the secret key
Message Authentication Requirements
1. Disclosure: Release of message contents to any person or process not possessing
the appropriate cryptographic key.
2. Traffic analysis: Discovery of the pattern of traffic between parties. In a
connection-oriented application, the frequency and duration of connections could be
determined. In either a connection-oriented or connectionless environment, the
number and length of messages between parties could be determined.
3. Masquerade: Insertion of messages into the network from a fraudulent source.
This includes the creation of messages by an opponent that are purported to come
from an authorized entity. Also included are fraudulent acknowledgments of
message receipt or nonreceipt by someone other than the message recipient.
4. Content modification: Changes to the contents of a message, including insertion,
deletion, transposition, and modification.
5. Sequence modification: Any modification to a sequence of messages between
parties, including insertion, deletion, and reordering.
Message Authentication Requirements
conti…
6. Timing modification: Delay or replay of messages. In a connection-
oriented application, an entire session or sequence of messages could be
a replay of some previous valid session, or individual messages in the
sequence could be delayed or replayed. In a connectionless application,
an individual message (e.g., datagram) could be delayed or replayed.
7. Source repudiation: Denial of transmission of message by source.
8. Destination repudiation: Denial of receipt of message by destination.
Message Authentication Functions
• The types of functions that may be used to produce an authenticator.
These may be grouped into three classes.
• Hash function: A function that maps a message of any length into a
fixed-length hash value, which serves as the authenticator
• Message encryption: The ciphertext of the entire message serves as
its authenticator
• Message authentication code (MAC): A function of the message and a
secret key that produces a fixed-length value that serves as the
authenticator
Message Encryption
• Symmetric Encryption
Basic Uses of Message Authentication code (MAC)