ForexMinute.com – Before we start, let us first understand what hash functions exactly are? A hash function is a mathematical algorithm that converts input data set into string (or strings). For example, suppose we have an algorithm that collects all the digits of a number. If the number is 1234, the algorithm will return the string 10.
It seems simple, but there are certain characteristics of good hash functions that make them suitable for use in cryptography. Keep them in mind because they are vital for the functioning of the Bitcoin protocol.
1. Calculating the hash for any input must be an easy task, but meanwhile, it is also impossible to estimate the incoming data, if you hash them, despite knowing the mathematical algorithm used for hashing. For example: We can calculate that hash is 10 at 1234 input array, but the reverse is not all that easy. In our case there are many possible values to return the same output, for example 55, 136, 7111 and others. Given the simplicity of our function, anyone can easily nick of initial array. Hash functions used in the industry, however, are so complex that they cannot be broken even by super computers.
2. Unlike our example, each hash must correspond to exactly one input data set. If two different initial array give the same hash result, we have a hash collision (from English hash collision). Good cryptographic hash algorithms do not have this problem.
3. Hash function must be able to work with input arrays with different size and therefore returns the string with a fixed size.
Hash must have the same length, regardless of whether the initial value has 10 or 10000 characters.
4. A small change in the input array should give a completely different hash, which is in no way connected with the hash of the original version of the input array. For example, see how very slight modifications to the equally important “Hello World” reflects the hash of this expression:
hello world: 98c615784ccb5fe5936fbc0cbe9dfdb408d92f0f
Hello World: a830d7beb04eb7549ce990fb7dc962e499a27230
Hello World! : 8476ee4631b9b30ac2754b0ee0c47e161d3f724c
Bitcoin uses a cryptographic hash function SHA256 (from English Secure Hash Algorithm 256-bit). These algorithms are developed by the National Security Agency (NSA) of the United States. You must be wondering whether we can trust them or not.
And indeed, it really is a reason to be suspicious, but the truth is that the algorithms are public and have been analyzed by hundreds of cryptography experts from around the world who have achieved consensus on their reliability.
To contact the writer of this article: Yashu Gola at email@example.com