Glossary index › S

SHA (Secure Hash Algorithm)

SHA stands for Secure Hash Algorithm, a family of cryptographic hash functions originally published by the US National Institute of Standards and Technology (NIST). In crypto trading, "SHA" almost always refers specifically to SHA-256, the hash function Bitcoin uses both to secure its blockchain and to power its mining process.

A hash function is a one-way calculation: feed it any input at all - a single word, one email, or an entire block's worth of Bitcoin transactions - and it always produces a fixed-length output, which for SHA-256 is exactly 256 bits, shown as a 64-character string. Two properties make it useful for security. First, it's effectively impossible to work backward from the output to reconstruct the original input. Second, changing even one character of the input produces a completely different, unpredictable output with no visible resemblance to the original - hashing the word "Bitcoin" and hashing "bitcoin" (just one letter's capitalization changed) yields two 64-character results that look nothing alike.

Bitcoin mining exploits that unpredictability directly: miners repeatedly hash a candidate block's data combined with a changing number (a nonce), searching purely by trial and error for a nonce that makes the SHA-256 output fall below the network's current difficulty target. There's no way to shortcut this search - it has to be brute-forced - which is exactly why it takes real, costly computing power to mine a block, and why altering a past transaction would require redoing the SHA-256 hashing on that block and every block since, faster than the rest of the network combined.

SHA-256 isn't unique to crypto - it's a general-purpose security standard also used to protect website encryption (TLS/SSL certificates) and to store passwords securely, among other applications. Within crypto, though, it's a useful way to tell proof-of-work coins apart: Bitcoin and several coins that mimic its mining process use SHA-256, while others use different hash functions - Litecoin uses Scrypt, for example - which matters practically because mining hardware built for one algorithm generally can't be repurposed to mine a coin that uses another.

An earlier member of this family was broken in public, and the story is the clearest argument for why the newer versions exist. SHA-1, the predecessor, produces a 160-bit output and was the standard for website certificates and software signing for years. Cryptographers warned from 2005 that attacks were becoming feasible, and on 23 February 2017 researchers at Google and CWI Amsterdam demonstrated the first practical collision: two different PDF files producing an identical SHA-1 hash. Producing it took roughly nine quintillion computations, an enormous but no longer impossible amount, and the demonstration ended SHA-1's use in anything that mattered. A collision means the function can no longer certify that a document has not been substituted, which is most of what these functions are used for.

SHA-256 has no comparable weakness and is a different construction with a longer output, but the episode is why a successor was standardised before one was needed. SHA-3, selected through a public competition and finalised in 2015, is built on entirely different mathematics precisely so that a structural break in one family would not compromise the other. The quantum question, which comes up constantly in crypto discussions, is less alarming than it sounds for hashing specifically: the best known quantum algorithm for searching, Grover's, roughly halves the effective strength of a hash function, so a 256-bit function would offer 128 bits of security against a quantum attacker. That remains far beyond reach. The genuine quantum threat in cryptocurrency is to the signature scheme that proves ownership of coins, not to the hash function that secures the chain.

Which SHA function matters in crypto? SHA-256, the function Bitcoin uses to secure its blockchain and to power mining.
What is a hash function? A one-way calculation that takes any input at all and produces a fixed-length output.
How long is a SHA-256 output? Exactly 256 bits, shown as a 64-character string.
What makes SHA-256 useful? Two properties: it is effectively impossible to work backwards to the input, and changing one character of the input changes the whole output unrecognisably.
How does one changed letter affect a hash? Hashing the word Bitcoin and hashing bitcoin, differing only in one capital letter, produces two 64-character results with no resemblance to each other.
How does mining use SHA-256? Miners repeatedly hash a candidate block combined with a changing number, searching by trial and error for one that makes the output fall below a difficulty target.
Why can mining not be shortcut? There is no way to work out which number will succeed. It has to be brute-forced, which is exactly why mining costs real computing power.
Is SHA only used in crypto? No. It is a general-purpose standard used in website encryption and password storage among many other things.

By InsiderTicker Editorial Team · Last updated

All news on Crypto →