SHA-256 is the Bitcoin protocol’s hash function and mining algorithm. It takes as input any type of document, file or series of characters and returns a unique 64-character output. What makes SHA-256 so powerful is the fact that input cannot be deduced from the output, which makes it safe. On the other hand, hash values can be stored and compared to the user’s input to see if it’s correct or not. This property of SHA256 is known as a ‘one-way’ function.
Other factors boosting the security of SHA256 include the fact that a bruce force attack is exceedingly difficult to carry out due to the enormous number of possible outputs, as well as extremely low probability that two data values will ever yield the same hash.
The algorithm is a modification of the National Security Agency’s SHA-2 (Secure Hash Method 2) algorithm (NSA). Popular encryption protocols like SSL, TLS, and SSH, as well as open-source operating systems like Unix/Linux, use algorithms from the SHA-2 family.