In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Hash functions are also called hash functions and hash functions. It is an one-way cryptosystem, that is, an irreversible mapping from plaintext to ciphertext, with only encryption process and no decryption process.
The hash function can transform the input of any length that meets the requirements to get a fixed-length output. This fixed-length output is called a hash of the original message or message digest (Message Digest). The mathematical expression of the hash function is:
Hype H (m)
Where H is a hash function, m is an arbitrary length plaintext, and h is a fixed length hash value.
The ideal hash function can get different hash values for different inputs. If x and x' are two different messages and there exists H (x) = H (x'), then x and x' are said to be a collision of the hash function H.
Because of this one-way feature and fixed length of hash function, it can generate message digest (also known as hash value, hash value) of messages or data blocks, so it is widely used in the field of data integrity and digital signature.
There are two typical types of hash functions: message digest algorithm (MD5) and secure hash algorithm (SHA).
1. Properties of Hash function
The hash function has the following characteristics:
① compression. For the input x of any size, the length of the hash value H (x) is very small, and the hash value produced by the hash function H is a fixed length in practical application.
② is easy to calculate. For any given message, it is easy to technology its hash value.
③ is unidirectional. For a given hash value h, it is not feasible to find m'so that H (m') = h is computationally infeasible, that is, it is difficult to find the inverse of the hash.
④ crashworthiness. The ideal hash function is collision-free, but it is difficult to do it in practical algorithm design. There are two kinds of collision resistance: one is weak collision resistance, that is, for a given message x, it is not computationally feasible to find another message y that satisfies H (x) = H (y), and the other is strong collision resistance, that is, for any pair of different messages (xMagin y), H (x) = H (y) is computationally infeasible.
⑤ has high sensitivity. When an input bit changes, more than half of the output bits will change.
two。 Application of Hash function
(1) message authentication
In an open communication network environment, information is faced with eavesdropping, forgery, modification, insertion, deletion, denial and so on. Therefore, it is necessary to provide a mechanism or service for verifying message integrity, that is, message authentication. The main function of this service is to ensure that the message received is exactly the same as that sent and that the source of the message is true and valid. The most common cryptographic technique for message authentication is the message authentication code based on hash function.
(2) Digital signature
Because the operation speed of asymmetric algorithm is slow, hash function plays an important role in digital signature protocol. The digital signature of the message digest can be considered statistically equivalent to the digital signature of the file itself.
(3) the security of password
Because the hash function is unidirectional, it is widely used in password protection. Usually, only the hash value of the password is saved, and the hash value can be compared when the password is verified. Even if the person gets the saved hash value, the export order cannot be calculated.
(4) data integrity
The familiar check algorithms are parity check and cyclic redundancy check code CRC. These two checks do not have the ability to resist data tampering, they can detect and correct information errors in data transmission to a certain extent, but can not prevent malicious destruction of data. The characteristics of hash algorithm message digest make it the most widely used data integrity check algorithm at present.
3. Message digest algorithm
Message digest algorithm MD5 can generate 128-bit message digest for any length of plaintext.
The MD5 algorithm is processed in terms of 512 bits, and messages of any length will first be filled into multiples of 512. First of all, the information of any length should be filled so that the length of the information is equal to the length of ≡ 512 mod 448, that is, the length of information 448 mod 512. The filling method is as follows: first, add a bit "1" after the message, and then add the bit "0" in turn until the length of the original message meets the condition; then, add the length of the original message as 64 bits at the end, making the length of the message exactly a multiple of 512 bits.
MD5 divides the populated message into L packets in 512 units, and then processes each packet. For each packet processing, four very similar operations are performed, and each round includes 16 similar steps.
The data processing of each step is carried out for the data of four 32-bit recording units. The initial values of the four recording units are represented by hexadecimal numbers as follows: Aq0123 4567, B = 89AB CDEF, C = FEDC BA98, D = 7654 3210. After 4 rounds of 64-step operations, 128 bits in the recording unit A, B, C, D are the output of the intermediate processing, which will be used as the input initial value of the next 512-bit packet processing. In this way, after all the L packets are processed, a 128-bit hash result is output.
When the first step of the first round starts processing, the values in the A, B, C, D recording units are first copied to the other four recording units AA BB CC DD. These four values will be added to the relevant A B C D in the last step of round 4. In the operation of each step, the data in the three recording units in the A B C D are processed in a non-linear operation mode, and the result is added to a 32-bit plaintext packet M [K] and a fixed number T [I] in the 512-bit plaintext packet. The result of the addition moves the S bit to the left loop (with the
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.