Secure Digest Functions

Praveen Ramanayake
3 min readJul 29, 2020

Cryptographic hashing algorithms are also known as hash functions basically scramble of data. In general, a hash function can take an arbitrary amount of data, apply a mathematical formula, and generate a output of a fixed length, called the hash. Sometimes hear that the original data referred to as the message, and the result is referred to as the message digest. Mostly, hashing is used as a convenient way to store data. Hashing is predicated on a few main concepts. The first is the fact that hashes are one-way; that is, it can use the hash and the data to construct the hash value, but, with the hash value, it can not find out the data. Hash functions can prevent collisions, as well. A collision is one in which two separate data sets generate the same hash value.

Hashing Algorithms

Hashing algorithms are as common as encryption algorithms, but a few are used more often than others. Other common hashing algorithms include MD5, SHA-1. In this article I’ll demonstrate on MD5 and SHA-1 algorithms.

Hashing Algorithm

MD5

MD5 is the fifth edition of the algorithm Message Digest. MD5 produces outputs which are 128-bit. MD5 was a hashing algorithm which was very widely used. This was before flaws started to appear in the algorithm. Most of those vulnerabilities were expressed as collisions. MD5 started to be phased out because of this.

MD5 Hashing

SHA-1

SHA means the secure hash algorithm. SHA-1 is the second edition of the Secure Hash Algorithm, with the first being SHA-0. SHA-1 or Secure Hash Algorithm 1 is a cryptographic hash function that takes an input and produces a hash value of 160 bits (20 bytes). SHA-1 is one of the key algorithms that began replacing MD5, after vulnerabilities were discovered. SHA-1 achieved widespread recognition and use. In addition, SHA-1 was known as a hashing algorithm compliant to FIPS 140.

SHA-1 algorithm steps

In this post I have demonstrated the hashing and two common hashing algorithms in cryptography. Soonly let’s meet with another article. Stay safe.

--

--