What are keyed cryptographic hash functions?

Overview

The keyed cryptographic hash function is also known as the Hash Message Authentication Code HMAC. It is used in conjunction with a cryptographic key to maintain the data’s authenticity and integrity as it is transferred over a network from the sender to the receiver.

How does it work?

The process of sending data using a keyed cryptographic hash function

Steps performed by the sender

  1. The Data.txt and a secret are passed into the HMAC function.

  2. The Data.txt is hashed and ciphered using the key, generating a MAC value. This MAC value is sent to the receiver and the unencrypted Data.txt file.

Steps performed by the receiver

  1. The Data.txt and a secret symmetric key are passed into the HMAC function.

  2. The Data.txt is hashed and ciphered using the key, generating a MAC value. This MAC value is sent to be checked with the MAC value received from the sender; if they both match, then the data has not been tampered with.

Pros

  • Authenticity: The receiver is confident about the identity of the sender.

  • Data integrity: During the data transmission, it is ensured that the data is not tampered with and its integrity is maintained. This is achieved by generating a MAC value at the receiver end to ensure that MAC values remain the same during transmission. This, in turn, ensures data integrity.

  • Easier to compute: HMACs are used in conjunction with a secret symmetric key, which is relatively easier to encrypt than public-private keys used in a.

Cons

  • Non-repudiation: If the data is forwarded to a third party, it is impossible to prove who is the actual data sender as anyone with a key can generate and send the message. Secondly, if there is a dispute between the key-holders as to who is the sender of the data, it is again impossible to prove who generated the data.

Free Resources