The SHA256 algorithm is a 256-bit cryptographic hash function. It’s the successor to SHA1, mapping an arbitrary data of any size (the input) to a hexadecimal string of 128 bits (the output).
Word or Phrase | SHA256 Value |
I love Bitcoin! | d587d1a3a8f2c981a992a12face6e4074a28d2509b834fd1154f53d24579ddf4 |
hello | 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03 |
You can replicate the above SHA256 value using the *nix tool “sha256sum.”
echo "hello" | sha256sum
Table of Contents
show
Where Is SHA256 Used?
- SHA256 hashes are used in bitcoin mining to create verifiably unique strings for transactions that identify their order in the block chain and prevent double spending without relying on centralized trust
- Web, SSH, and FTP servers use them to detect accidental modifications or deletions of critical files
- Email systems use them as an anti-spam measure within emails by attaching messages from one sender into a single envelope so they can’t be presented as separate ones while passing through a message transfer agent (MTA)
Hash functions have incredible utility and the above examples represent only a few of them.