Probing Secure Hash Algorithm

Amajuoyi Samuel Kelechukwu
Bootcamp
Published in
5 min readJun 17, 2022
Image showing types of secure hash algorithms

What is a Secure hash algorithm?

Secure Hash Algorithms, or SHA, are a group of cryptographic algorithms that are used to keep data secure. It operates by employing a hash function to change the data.

What is a hash function?

A hash is a mathematical formula used in cryptography that turns any message or data into a fixed-length code. Consider it an encryption method in which communications are mathematically transformed into a fixed-length sequence of numbers and characters.

Here’s an example of what a target hash might look like which I generated using this SHA256 Hash generator

A hash function’s output is referred to as a cryptographic digest. A cryptographic digest is a one-of-a-kind, fixed-length tag that identifies a specific piece of information. It is used to detect tampering because even minor changes to the data input to the hash function produce a completely different output.

Generation and Development of Secure Hash Algorithm

NIST created the Secure Hash Algorithm (SHA) in 1992, which is based on the MD4 algorithm. A vulnerability in SHA was discovered, and a correction (SHA-1) was released two years later.

The US National Security Agency created the Secure Hash Algorithm (NSA). There are also SHA-224, SHA-256, SHA-384, and SHA-512 algorithms. SHA-1 has a bit count of 160. Others have the number of bits after the SHA.

SHA-1 is said to have been hacked, however the reliability of the allegations has been called into question. In any event, the NSA developed the SHA-256 specification to make it much harder to break.

The total number of 256-bit numbers is equal to 2²⁵⁶.

Christian Rechberger and Christophe De Cannière claimed to have identified a collision attack on SHA-1 that would allow an attacker to pick at least parts of the message during the CRYPTO 2006 Rump Session.

That’s where SHA-2 comes in…

The SHA-2 family of functions accomplishes the same goal as SHA1: they generate a collision-resistant cryptographic hash of a given input as a fixed-length output. The National Security Agency (NSA) created SHA-2 to address potential flaws in SHA1. By enhancing collision resistance, the new design increased security.

The SHA-256 algorithm is a variant of SHA-2 (Secure Hash Algorithm 2), a successor to SHA-1 developed by the National Security Agency in 2001. The SHA-256 hash function is a patented cryptographic hash function that generates a 256-bit result.

What is a Cryptographic Hash Function (SHA-256) and why is it important?

Cryptographic hash function is an algorithm that receives in arbitrary amount of data — a credential — and creates a fixed-size output of encrypted text known as a hash value, or simply “hash.” That encrypted text can then be saved in place of the password and used to validate the person later.

For example, Bitcoin, the original and largest cryptocurrency, uses the SHA-256 cryptographic hash function in its algorithm.

Cryptographic hashing modifies hashed data in such a way that it becomes fully unreadable. Converting the 256-bit hash stated above back to its original 512-bit version would be nearly hard. So, why would you want to send an unrecoverable scrambled message? The most typical reason is to double-check the substance of confidential information. Hashing is used to verify the integrity of secure messages and data, for example. The hash code of a secure file can be made public so that people who download it can verify that they have the correct version without revealing the file’s contents. Hashes are used to validate digital signatures in a similar way.

Cryptographic hashing’s most essential use is password verification. Storing users’ passwords in plain text is a disaster waiting to happen; any hacker who gains access to the document will find a treasure trove of unprotected credentials. As a result, storing the hash values of passwords is more safe. The hash value is calculated and compared to the table when a user inputs a password. It’s a legitimate password if it matches one of the recorded hashes, and the user can be granted access.

Properties of cryptographic hash functions that impact the security of password storage.

  • One-way function or non-reversibility: A decent hash should make reassembling the original password from the output or hash extremely difficult.
  • The avalanche effect, or diffusion: If one piece of the original password is changed, half of the hash should be changed as well. To put it another way, if a password is altered slightly, the output of encrypted text should vary dramatically and unexpectedly.
  • Determinism: The hash value or enciphered text generated by a particular password must always be the same.
  • Resistance to collisions: Finding two separate passwords that hash to the same enciphered text should be difficult.
  • Non-predictable: The hash value should not be inferred from the password in any way.
bitcoin website

Above is a wallet address obtained from bitcoin.org and below we can see the cryptographic hash function being used to map an indeterminate size of data into a fixed size of data. Or more plainly, it provides a number quantity that represents the input data.

Clicking on the hash to generate the transaction summary, transaction input and transaction output…

Transaction summary
Transaction inputs
Transaction outputs

With all said and done, using the SHA-256 cryptographic hash function SHA-256 we can ensure data integrity and protect stored passwords.

Thank you for your time!

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also, Read

--

--

Amajuoyi Samuel Kelechukwu
Bootcamp

Product Designer | UX Researcher | Interpreting and Onboarding next billion users to web3 by breaking down web3 protocols. https://www.linkedin.com/in/samuel-am