Skip to content

Applications of Hashing

Janvi Talreja edited this page Jan 2, 2023 · 7 revisions

Applications of Hashing

There are multiple real-world applications of hashing like:

  1. In Cryptography algorithms for verification purposes
  2. In String matching algorithms like the Rabin Krap algorithm
  3. Data Integrity

Cryptography Algorithms

Hashing simply transforms plain text into a special text using a hashing algorithm or a hash function.

Hashing enables people to get data authorization without knowing the content on the data. We use hashing algorithms and databases to store passwords. Passwords The following hashing algorithms are available:

  1. MD5
  2. SHA Algorithmsare saved in the form of a hash value or a hash password rather than as plaintext. The hash value makes the data more secure.

The main purpose of hashing here is:

  1. To verify data integrity.
  2. Authentication.
  3. To store sensitive data.

The following hashing algorithms are available:

  1. MD5
  2. SHA Algorithms

MD5 Algorithm:

An MD5 hash is created by taking a string of any length and encoding it into a 128-bit fingerprint. Encoding the same string using the MD5 algorithm will always result in the same 128-bit hash output. MD5 hashes are commonly used with smaller strings when storing passwords, credit card numbers, or other sensitive data in databases such as the popular MySQL.

MD5 hashes are also used to ensure the data integrity of files. Because the MD5 hash algorithm always produces the same output for the same given input, users can compare a hash of the source file with a newly created hash of the destination file to check that it is intact and unmodified.

SHA Algorithms like SHA-11, SHA-256

SHA-1 SHA-1 or Secure Hash Algorithm 1 is a cryptographic hash function that takes an input and produces a 160-bit (20-byte) hash value. This hash value is known as a message digest. This message digest is usually then rendered as a hexadecimal number which is 40 digits long.

  1. String Matching Algorithms: Rabin Karp The Rabin Karp algorithm matches the hash value of the pattern with the hash value of the current substring of text, and if the hash values match then only it starts matching individual characters. So Rabin Karp algorithm needs to calculate hash values for the following strings.

  2. Pattern itself

  3. All the substrings of the text of length m

It uses a rolling hash to quickly filter out positions of the text that cannot match the pattern, and then checks for a match at the remaining positions.

  1. Data Integrity Hashing checks for data integrity. It gives the user assurance that no data has been modified and the data is correct. It also assures the user that the data is original.
Clone this wiki locally