2023-08-30 - By Robert Elder
I use the 'sha256sum' command to compute the SHA256 checksum of a file or stream:
What Is SHA256?
As of 2023, SHA256 is the most commonly used member of the SHA 2 family of hash functions, and is still considered to be cryptographically secure. The SHA256 algorithm is widely used by many applications, such as the bitcoin consensus algorithm, TLS certificates, and password hashing mechanisms.
SHA256 works by splitting the input message into 512 bit blocks consisting of 16 32 bit values. The hashing process is initialized using these 8 constants:
that consist of "the first thirty-two bits of the fractional parts of the square roots of the first eight prime numbers", as described by the FIPS-180 standard.
Then, 64 rounds of logical operations are performed to produce the final 256 bit hash output:
Other Standard Features Of 'sha256sum' Command
All of the SHA family checksums commands support the same flags and features, such as reading input from stdin:
echo "Hello World!" | sha256sum
or verifying checksums in the following file 'sha256-checksums.txt':
using this command:
sha256sum -c sha256-checksums.txt
And that's why the 'sha256sum' command is my favourite Linux command.
A Surprisingly Common Mistake Involving Wildcards & The Find Command
A Guide to Recording 660FPS Video On A $6 Raspberry Pi Camera
Intro To 'stty' Command In Linux
The Most Confusing Grep Mistakes I've Ever Made
Intro To 'comm' Command In Linux
Use The 'tail' Command To Monitor Everything
How To Force The 'true' Command To Return 'false'
Why Bother Subscribing?