What is the HMAC message authentication ...

What is the HMAC message authentication system in cryptography? How to deploy it on crypto

Dec 01, 2020

★HMAC, a popular authentication mechanism used for authenticating a message using cryptographic hash functions.

Image for post

HMAC message authentication system:

★HMAC, a popular authentication mechanism used for authenticating a message using cryptographic hash functions. We can use HMAC with any iterative cryptographic hash function family, in combination with a shared secret key. The strength of HMAC depends on the underlying properties of the cryptographic hash function. In today’s computing world HMAC providing a necessary way to check the integrity of the message transmitted either stored in an unreliable medium. The mechanism used by HMAC to perform an integrity check on a shared secret key between two parties called the Hash message authentication code (HMAC).

Design and Development:

★In this section, we use HMAC to design and develop a message-based system to encrypt and decrypt messages using an RSA algorithm. We implement and verify both the integrity and authenticity of messages between the two campuses and the required procedures such as designing, developing, testing various operations documented with cryptool open-source software.

Step 1: First, click on the left side navigation bar “NEW” icon in the Menu section as shown below in Fig1.

Image for post

In Fig.1 To create a new project (workspace).

On the left side, CrypTool 2 (CT2) contains various classical and modern ciphers. We will use the search tool to fetch our ciphers.

Step 2: Open a “Text Input” file using the component “search” box. Find the “search” on the left side of the cryptool workspace. We will create two “Text Input” files as like shown in Fig.2.

Image for post

In Fig.2 To create a text input and a Key input.

Step 3: Now, we need to add an “AES” encryption algorithm to the workspace. Use the component “search” box to find AES.

Note: 1. Set Action to “Encrypt”.

2. Set Key size to “256 bit”.

Image for post

In Fig.3. To create an “AES” algorithm.

Step 4: Now, we will add an “SHA” algorithm file into the workspace and establish a link between “Text Input”, “SHA”, and “AES” as shown in Fig.22.

Note: 1. Set SHA function to “SHA-256”.

Image for post

In Fig.4 To Add an “SHA” Algorithm and establish links between AES, key, SHA, and Text input files.

Step 5: Now, we need to add an “AES” for decryption purposes to the workspace. Use the component “search” box to find AES.

Note: 1. Set Action to “Decrypt”.

2. Set Key size to “256 bit”.

Image for post

In Fig.5 To create an “AES” decryption.

Step 6: Now, we will add an “SHA” algorithm and a “Text Input” file into the workspace and also establish a link between “Text Input”, “SHA”, and “AES” as shown in Fig.6.

Note: 1. Set SHA function to “SHA-256”.

Image for post

In Fig.6 Create an SHA, Text input file, and establish a link.

Step 7: Add a “String encoder” and a “Text Output” file to the workspace and to establish a link between them.

Image for post

In Fig.7. To Add a string encoder and a Text output file.

Step 8: To provide the Plaintext message and pre-defined shared “key” in the “Text input” box.

Image for post

In Fig.8 Plaintext and key fed into the Text input boxes.

Step 13: Finally, click on the “Play” button. If Cryptool runs the simulation successfully. It encrypts and decrypt the plaintext and the key on the left side and display it exactly to the right side by using the SHA code system. Q.E.D.

Image for post

In Fig.9 AES Encrypt and Decrypt with a hashing code system.

HMAC Integration with AES and SHA:

Step 1: Add an “HMAC” algorithm and a “Text Input” into the existing workspace for encryption purposes. After that to establish a link between them as shown in Fig.10.

Note: Set HMAC to “Md5”.

Image for post

In Fig.10 To add HMAC into the workspace.

Step 2: Add a “String comparator” and establish a link between the HMAC.

Image for post

In Fig.11 To add a string comparator.

Step 3: Add an “HMAC” algorithm and a “Text Input” for decryption purposes.

Image for post

In Fig.12 Add HMAC into the decryption.

Step 4: To establish a link between “Stream comparator” and “HMAC”.

Image for post

In Fig.13 Link establishment.

Step 5: Add a “Boolean Output” and establish a link between the “Stream comparator”.

Image for post

In Fig.14 Boolean output linked with Stream comparator.

Note: Play the simulation and check whether the boolean return the integrity of the message.

Image for post

In Fig.15 Boolean returns the value.

Step 6: Add a “Gate” to the stream comparator. Then link the AES encryption to the Gate and Gate to AES decryption as shown in Fig.16.

Image for post

In Fig.16 Gate linked with Boolean.

Step 7: Set the “Gate” value to “True”.

Image for post

In Fig.17 Set the Gate value to “true” in the trigger section.

Step 8: Finally, click on the “Play” button. If Cryptool runs the simulation successfully. It encrypts and decrypt the plaintext and the key on the left side and display it exactly to the right side by using the HMAC system. Boolean judges the system whether the message has tampered. If they do not tamper with it, pass it over the gate and the gate sends it to AES for decryption and the final plaintext is revealed on the other side. Q.E.D.

Image for post

In Fig.18 HMAC integration result.

HMAC Integration with RSA: Part 1

Step 1: Message-based system to encrypt and decrypt messages using an RSA algorithm.

Image for post

In Fig.19 Message-based digest encryption and decryption with RSA.

Step 2: To integrate the HMAC system by adding a “Text Input”, “Steam comparator”, “boolean output”, and “Gate” files into the workspace and link them accordingly as shown in Fig.20.

Image for post

In Fig.20 HMAC integration and link establishment.

Step 3: Finally, click on the “Play” button. If Cryptool runs the simulation successfully. It encrypts and decrypt the plaintext and the key on the left side and display it exactly to the right side by using the HMAC system. Boolean judges the system whether the message has tampered with. If they do not tamper with it, pass it over the gate and the gate sends it to RSA for decryption and the final plaintext is revealed on the other side. Q.E.D.

Image for post

In Fig.21 HMAC integration with RSA -final result.

System strengths and weaknesses:

The strength of HMAC depends on the underlying properties of the cryptographic hash function. The key and the message in this prototype hashed separately. AES efficient key management system and computation helped us to meet the integrity and authenticity requirements effectively.

Conclusion:

This report presents the solution for students to develop a secure data transfer system from Port Macquarie to Canberra Campus vice versa and to better the enablement of dynamic service across the points. This report describes a practical algorithmic approach that applied in between the different campuses or locations or gov offices. After experimentation and extensive analysis, we made the ultimate design decision pledge to use the AES algorithm to establish a secure Web data transfer system between the two campuses in the Task1. In Task 2, we used a message-based system to encrypt and decrypt the text using symmetric and asymmetric algorithms and integrated the HMAC algorithm into the prototype. This report elaborates on the cryptographic algorithm design requirements that led to this choice and presents detailed aspects of the security system and implementation method and detailed scenarios screenshot in this report. The key purpose is to ensure the integrity and authenticity of data. Exchanging keys securely is not a major issue in AES. RSA algorithm is reliable for key exchange management but it’s not very efficient in terms of performance and cost factor. Therefore, we conclude our research report and recommend using the AES algorithm for implementation consideration.

 — — — — — — — — — THE END — — — — —— — — —— —

Quote of the day: "I am not afraid of an army of lions led by a sheep; I am afraid of an army of sheep led by a lion." — Alexander the Great.

Thanks for reading👍!

Only Buy me a coffee if you enjoyed it 😊!!!

Appreciate it forever!!!

Have a pleasant day🌞!

— — — — — —— — — — —  — — — — —— — — — —— —

About Me:

Founder of gtmars.com & plan2trip.com. From time to time I share knowledge in the digital world about Cybersecurity, Technology, the Space industry, Traveling, Japanese Haiku poems.

My blogs😂: Connect with the one you like!

https://hackernoon.com/u/gtmars.com

https://gtmars.medium.com/

https://www.facebook.com/Gtmarscom-113569997170307

https://twitter.com/gtmars2

https://www.instagram.com/gtmars2020

https://www.linkedin.com/company/gtmars/

Enjoy this post?

Buy gtmars a coffee

2 comments

More from gtmars