Hashing is a very important technique and has extremely high applicability, especially in the field of security. Today’s article will give you a basic look at Hash and some of its practical applications.
What is hashing?
Hashing is the process of turning an input content of any size and size and then using algorithms and mathematical formulas to turn it into a standard output of a certain length. That process uses hash functions.
Cryptographic hash functions
The cryptographic hash function is used for data encryption purposes. Cryptographic hashes are like regular hashes but possess a number of other characteristics, the most important is irreversible… This means that when you have in hand the value after the hash, you cannot know what the original value was.
In addition, a cryptographic hash function also has some other characteristics such as collision avoidance (occurs when two different values but when run through the hash function returns the same two results), efficiency (time computation of hash values must be fast), and sensitive (only small changes in the initial value can change the hash value completely).
Common hashing functions
- MD5: MD5 was designed by Ronald Rivest in 1991 to replace the previous MD4 hash function and was made standard in 1992 in RFC 1321. MD5 produces a 128-bit (16-byte) summary.
- SHA-1: short for Secure Hash Algorithm, developed as part of the US Government Capstone project. SHA-1 produces a 160-bit (20-byte) summary.
- SHA-2: is a set of cryptographic hash functions designed by the US National Security Administration (NSA), first published in 2001. They are built using the Merkle – Damgård structure, Its one-way compression functionality is constructed using a Davies – Meyer structure from a dedicated block cipher system.
What is a hash used for?
Checking file integrity: same value yields the same hash. So we can compare files we downloaded online with the originals by comparing their hash values against each other. Checking hash helps make sure your files are safe.
Verifying password: When you enter your password, your password will be run through the hash function, which will be compared with the hash value in the database to decide whether you are authenticated to use the service, are not? This greatly reduces the damage when the database is under attack When what comes out are your hash values, not your password.
As you can see, Hashing is a very important technique and has extremely high applicability, especially in the field of security. Developers are constantly having to design new hashing algorithms, as the old ones are quickly decoded by the rapid evolution of technology. Once an algorithm is cracked, it is no longer absolutely secure. Understanding the basic properties and how a hash function works is indispensable for every programmer.