Hash Function
Hash function is almost used in the information security phase, and also it is a transformation of a string of characters into a shorten fixed value or for a key.
In hashing or in the hash function what we do is generate a hash value or a digest using the Message authentication code (MAC), and send that hash value with the message.
Let's see how the hash function is working.
As this picture describes Alice want to send a message to Bob. Alice make the message and using hash function she gets the message hash value and we call it as the message digest. Then that calculated message digest combines with the message and send it to Bob and send the hashing method too to the Bob.
When Bob received the message recalculate the hash value (message digest) using the hash method sent by Alice. Now Bob also get a hash value and Bob can compare those two hash values (H1 and H2). If those hash values similar or almost similar Bob can recognize the message sent by Alice is not change by any party on the way of message receiving.
Important Facts
- If we use hash function for a message sending process we will not be able to get the original message as readable by only calculating hash value. By the hash value we only can recognize that the message has change or not change on the receiving way.
- Hash values can be similar totally or can be almost similar.
- Can't have same hash value for different messages but the length of the hash function is similar for every messages.
Hashing vs Encryption
Key Hash Function
When you heard the word hash function you will remember the thing what we have describe above. But in this time what we are talking is Key Hash Function and in this method we don't have any hash function or we don't make separate message digest using this method.
Let's see what's going on here,
As described in the above chart main message divide to three parts and 1st part of the message encrypt and get a cipher text 1 and then that encrypted cipher text 1 combined with the 2nd part of the message using a logical function and make the cipher text 2. Then again we got a cipher text and with that cipher text 2 we combined the 3rd part of the message and do an encryption and got the cipher text 3 and that the message we make for a send.
Now you can see we didn't use any kind of hash function for the above scenario and just do a encryption that's why we called it as a Key Hash Function.
If we try to decrypt the message we have to go reversely through the way we come encrypting the message. If we decrypt the final cipher text we are stuck in the logic function, and to go to the next step we have to know the logic or the 3rd part of the message or the 2nd cipher text. So it is not an easy task to do.
Digital Signature
Digital signature
demonstrate the authenticity of a digital message and digital signature make
the receiver to believe that the message was created by the known original
sender.
Let's see how the
Digital Signature work.
First we do the hash function and get the hash value of the message what we want to send and encrypt the hash value using senders private key. The encrypted key what we have now it is a digital signature.
Digital signature also a signature puts by the message sender saying that i'm the sender. Digital signature also a part of a hash function.
Let's see how the digital signature work reversely.
After receiver gets the message and decrypt the message by sender's public key and get a hash value again.
After reversely gets the hash value compare those two hash values. In here we can recognize if the message has change or not by comparing those hash values as done in the hash function.
Very useful information.. thanks..
ReplyDelete