Hashing
A hash algorithm is used to map a message of arbitrary length to a fixed-length message digest.
About Hashing
Hashing is sometimes referred to as one way encryption, because hashed data cannot be reversed to get the original value. For every unique input, hash function will produce unique output. Hashing two inputs that vary in single character will produce hashed values that won't give any impression the inputs are almost similar.
SHA-3
SHA stands for Secure Hash Algorithm. This hash method was developed in late 2015 and is the latest approved by NIST. FIPS 202 specifies the new SHA-3 family of permutation-based functions based on KECCAK. FIPS 202 specifies:
- Four fixed-length hash algorithms: SHA3-224, SHA3-256, SHA3-384, and SHA3-512
- Two "extendable-output" functions (XOFs): SHAKE128 and SHAKE256
Currently only the four fixed-length SHA-3 algorithms are approved hash algorithms, providing alternatives to the SHA-2 family of hash functions
SHA-2
The second version of SHA, called SHA-2, has many variants. SHA-2 is the precedessor to SHA-3 and probably the one most commonly used hash algorithm as of this writing. There are four variants in SHA-2 family of hash algorithms: SHA-224, SHA-256, SHA-384 and SHA-512. The SHA-256 algorithm is most popular and widely used. This algorithm returns hash value of 256-bits, or 64 hexadecimal digits. While not quite perfect, current research indicates it is considerably more secure than either MD5 or SHA-1. Performance-wise, a SHA-256 hash is about 20-30% slower to calculate than either MD5 or SHA-1 hashes.
SHA-1
This is the first version of the algorithm in the SHA series, and is the precedessor to SHA-2. Whereas MD5 produces a 128-bit hash, SHA1 generates 160-bit hash (20 bytes). In hexadecimal format, it is an integer 40 digits long. Like MD5, it was designed for cryptology applications, but was soon found to have vulnerabilities also. As of today, it is no longer considered to be any less resistant to attack than MD5.
MD5
The MD5 hash function produces a 128-bit hash value. It was designed for use in cryptography, but vulnerabilities were discovered over the course of time, so it is no longer recommended for that purpose. However, it is still used for database partitioning and computing checksums to validate files transfers.