Hash Function VPN
Summary:Hash function, also known as HASH function, mainstream hash algorithms include MD5 and SHA-1. The main task of hash function is to verify the integrit…
This book is available as an e-book in EPUB format
PayPal sponsors this website for any amount. I will send you an EPUB e-book via email. Please send me an email
Email: shuxueha@outlook.com
PayPal: https://paypal.me/zhipinglei
You can also scan the PayPal QR code below to sponsor
You can also purchase this book on Amazon: click to enter the Amazon official website
Hash function, also known as HASH function, mainstream hash algorithms include MD5 and SHA-1. The main task of hash function is to verify the integrity of data. The result calculated through hash function is called hash value, which is often referred to as the fingerprint of data. Why is a hash function called the fingerprint of data? This is because the working principle of hash functions is almost the same as how we collect and use fingerprints in our daily lives. Before explaining the working principle of hash functions, let's first recall how we collect and use fingerprints in our daily lives!
Step 1: Public security agency 1 pre records the fingerprint of "user X"!
Step 2: At a certain crime scene, the public security organs obtained the fingerprint of the "suspect" called "fingerprint two"!
Step 3: By querying the fingerprint database, it is found that "fingerprint one" is equal to "fingerprint two"!
Step 4: Due to the uniqueness of fingerprints (conflict avoidance), it can be determined that the criminal "suspect" is "user X"!
The above are the methods for collecting and using fingerprints in daily life. Next, we can learn about the working principle of hash functions and see how they verify data integrity!
Step 1: Perform hash function calculation on the "important file" to obtain the hash value "Hash Value One"!
Step 2: Now we have received another file "File?", and we will perform a hash function on it to calculate the hash value "Hash Value 2"!
Step 3: Compare "Hash Value One" and "Hash Value Two" and find that "Hash Value One" is equal to "Hash Value Two"!
Step 4: Due to the uniqueness of hash values (conflict avoidance), it can be determined that "file?" is the "important file"! Every bit in these two files is exactly the same!
Hash functions have the following four characteristics!
Fixed size: Hash functions can receive data of any size and output a fixed size hash value. Taking MD5 as an example, regardless of the size of the original data, the hash value calculated through MD5 is always 128 bits, while the output length of SHA-1 is 160 bits!
Avalanche effect: Even if one bit of the original data is modified, the calculated hash value will undergo significant changes!
Unidirectional: It is only possible to calculate the hash value from the original data, and it is impossible to recover even one bit of the original data from the hash value!
Conflict avoidance: It is almost impossible to find another data with the same hash value as the current data, so hash functions can ensure the uniqueness of the data!
Now let's take a look at how hash algorithms verify the integrity of data!
Step 1: Use a hash function to calculate the hash value of the "important file" that needs to be sent, and obtain "hash value one"!
Step 2: Pack the "important files" that need to be sent and the "hash value one" calculated in step 1, and then send them together to the recipient!
Step 3: The recipient performs a hash function calculation on the received 'important file' to obtain 'hash value two'!
Step 4: The receiver compares the "hash value one" in the received file with the "hash value two" calculated in step 3. If the two hash values are the same, then based on the avalanche effect and conflict avoidance characteristics of the hash function, the integrity of the "important file" can be determined, that is, this "important file" has not been tampered with by others throughout the transmission process!
Although hash functions can effectively confirm the integrity of data, they are susceptible to man in the middle attacks. Let's take a look at how man in the middle attacks are carried out!
Both legal and illegal users can perform hash function calculations on the information they send, and obtain hash values. Therefore, they can also package plaintext information and hash values together and send them to the receiver, and the receiver can verify the integrity of the data through the hash function. Therefore, although the hash function can confirm the integrity of the data, it cannot guarantee that the data comes from a trusted source (without providing source authentication), so there is a problem of man in the middle attacks in hash functions!
To address this vulnerability, we can use a technique called Keyed hash Message Authentication Code (KBC), which not only enables integrity verification but also completes the task of source authentication. It introduces how KBC technology helps OSPF dynamic routing protocol to verify routing update packets!
Step 1: Firstly, the network administrator needs to configure the pre shared secret "cisco" on the two routers that need to establish OSPF neighbor relationships using the IP OSPF message digest key 1 md5 cisco command!
Step 2: The sender adds the routing update information to be sent and performs hash calculation together with the shared secret to obtain "Hash Value One". This technique of calculating the hash value together with the shared secret is called HMAC!
Step 3: The sending router encapsulates the "hash value one" obtained in step 2 through the KBC technology and the plaintext routing update information, and sends them together to the receiving party (note that the routing update information is sent in plaintext and absolutely not encrypted)!
The next steps to be performed on the receiving side for verifying the KBC!
Step 1: Extract plaintext routing update information from the received message!
Step 2: Hash the plaintext routing update information extracted in Step 1 with the shared key "cisco" pre configured by the receiving router to obtain "Hash Value 2"!
Step 3: Extract the "hash value one" from the received message and compare it with the "hash value two" calculated in step 2. If they are the same, it indicates that the routing update information has not been tampered with and is complete. At the same time, it can also be confirmed that this is a routing update sent by the neighboring router that has pre configured the shared secret, because only this router knows the content of the shared password, and therefore only it can create a hash value that can be verified successfully through KBC technology!
The above introduction to OSPF routing updates can reflect the two major security features of HAC, integrity check and source authentication. It should be said that in practical applications, it is not necessary to simply use hash functions. In the vast majority of cases, HAC technology is used. For example, IPsec and HTTPS technologies both use HAC technology to perform integrity check and source authentication on every transmitted packet!
| High-speed VPN | Fast VPN | Preferred Accelerator VPN | Reliable VPN |
| High quality VPN | Old fashioned VPN | Stable VPN(Recommend) | Smooth VPN |

