The acronym SHA-256 makes mention of the hash function that has been chosen for the operation of many cryptocurrencies because it offers a high level of security, which makes it perfect for the task of securely protecting and encoding their information.

EThere are many systems to encode information and one of them is the SHA-256 algorithm. This is an algorithm of hash which is used by Bitcoin to guarantee the integrity of the information stored in a blockInter alia.

Like almost all the advances in cryptography stuff, the governments of the world have had a fundamental role due to wars. The algorithm SHA or Secure Hash Algorithm (Secure Hash Algorithm), is one of these advances. This cryptographic algorithm was developed by the United States National Security Agency (NSA) and National Institute of Standards and Technology (NIST). Its objective is to generate hashes or unique codes based on a standard with which documents or computer data could be secured against any external agent that wishes to modify them. This algorithm was and is a great advance in the way to guarantee the privacy of the content in the information processing.

In 1993 the first SHA protocol, also colloquially called SHA-0, came to light. Two years later, a stronger, improved variant was released, the SHA-1. A few years later it was launched SHA-2, which has four variants according to the number of bits, such as SHA-224, SHA-256, SHA-384 y SHA-512.

Features of the SHA-256 algorithm

A hash algorithm works in one direction only: this means that from any content we can generate its hash (its “digital fingerprint”) but from a hash there is no way to generate the content associated with it, except by trying randomly until we find the content.

Among the different ways to create hashes, the algorithm used by SHA-256 is one of the most used for its balance between security and computational cost of generation, since it is a very efficient algorithm for the high collision resistance it has.

Another peculiarity of the SHA-256 hashing algorithm is that the length of the resulting hash is always the same, no matter how long the content you use to generate the hash: either one letter or all the words in Harry's book Potter integer, the result is always a string of 64 letters and numbers (with a 256-bit, 32-byte encoding).

Demonstration of how the SHA-256 hash works

How much do you know, cryptonuta?

Is SHA-256's security guaranteed for a long period of time?

TRUE!

Cryptanalyses carried out on SHA-256 guarantee that this algorithm will be safe for a long time (at least 20 years), enough time to generate powerful new algorithms if necessary.

What is the purpose of the SHA-256 hash?

The purpose of the SHA-256 hash (and of any hash function) is to generate a summary. To understand this in a simple and more detailed way, do not miss the chapter dedicated to explaining the functions hash.

In Bitcoin, SHA-256 is used for mining process (creation of bitcoins), but also in the process of generating bitcoin addresses. This is so due to the high level of security it offers.

Within the blockchain network all the nodes they would have a copy of the 64-character hash representing the information that represents, for example, an entire block. Once that information is validated by the network (or what is the same, has already been registered in the chain) any manipulation of that information trying to modify some character of the validated hash, would be detected immediately and would be discarded.

To increase the technical information about this cryptographic hash function, we recommend you download and read the paper in Spanish "Cryptography: SHA-256 function" de Javier Domínguez Gómez, Spanish software engineer and hacktivist at Free Software Foundation y Electronic Frontier Foundation.

If you want to test you can access this SHA-256 based password generation page, by clicking here.