Open In App

Message Digest in Information security

Message Digest is used to ensure the integrity of a message transmitted over an insecure channel (where the content of the message can be changed). The message is passed through a Cryptographic hash function. This function creates a compressed image of the message called Digest.

Lets assume, Alice sent a message and digest pair to Bob. To check the integrity of the message Bob runs the cryptographic hash function on the received message and gets a new digest. Now, Bob will compare the new digest and the digest sent by Alice. If, both are same then Bob is sure that the original message is not changed.





This message and digest pair is equivalent to a physical document and fingerprint of a person on that document. Unlike the physical document and the fingerprint, the message and the digest can be sent separately.



Example:
The hash algorithm MD5 is widely used to check the integrity of messages. MD5 divides the message into blocks of 512 bits and creates a 128 bit digest(typically, 32 Hexadecimal digits). It is no longer considered reliable for use as researchers have demonstrated techniques capable of easily generating MD5 collisions on commercial computers.
The weaknesses of MD5 have been exploited by the Flame malware in 2012.

In response to the insecurities of MD5 hash algorithms, the Secure Hash Algorithm (SHA) was invented.

Implementation:
MD5 hash in Java

Related GATE Questions:
GATE-CS-2014-(Set-1)
GATE-CS-2016 (Set 1)

Article Tags :