SHA-2 (Secure Hash Algorithm 2), of which SHA-256 is a part, is one of the most popular hashing algorithms out there. In this article, we are going to break down each step of the algorithm as simple as we can and work through a real-life example by hand.
SHA-2 is known for its security (it hasn’t broken down like SHA-1), and its speed. In cases where keys are not being generated, such as mining Bitcoin, a fast hash algorithm like SHA-2 often reigns supreme.
If you want to read more about hash functions in general, do so here. That said, in order to move forward let’s recap three of the main purposes of a hash function:
SHA-2 is an algorithm, a generalized idea of how to hash data. SHA-256 sets additional constants that define the SHA-2 algorithm’s behavior. One such constant is the output size. “256” and “512” refer to their respective output digest sizes in bits.
Let’s step through an example of SHA-256.
01101000 01100101 01101100 01101100 01101111 00100000 01110111 01101111
01110010 01101100 01100100
01101000 01100101 01101100 01101100 01101111 00100000 01110111 01101111
01110010 01101100 01100100 1
#algorithms #cryptography #hash functions #security #cybersecurity #infosec #secops #sha-256