SHA-256 Generator

SHA-256 Step by Step

Binary Conversion and Padding
The SHA-256 hash function requires the message, that is to be hashed, to be in bit format and a has a length of a multiple of 512 bits. The following four steps illustrate that process.

1. Original message conversion


The SHA-256 hash function works with bits, because of this the original message needs to be converted.


2. Padding


The message needs to be a multiple of 512 bits, this means the message length plus the number of padded bits in addition to 64 bits must equal a multiple of 512 bits. Padded bits start with an 1 and the rest are zeros.

To calculate r we subtract 64 bits, 1 of our padded bit and L = length of the original message from "512 bits".

3. Length of bits


After appending the padding part to the original message, L (length of the message in 64 bits) needs to be concatenated to make the message equal to a multiple of 512 bits. The original message length is calculated with modulo 232.

4. Entire message block


To get the entire message block, the length of the message, the padded bits and the 64 bit length are appended together and should equal a length of a multiple of 512 bits (N x 512 bits).
Compression function
Result

The SHA256 Step by Step tool is intended to directly explain to you the creation of a hash with the SHA256 algorithm during practical application.
The input message can be given in hexadecimal or as a string – adjustable with the corresponding switch.
The individual steps and the corresponding explanations and calculations are divided into “Binary Conversion and Padding” and “Compression function”. These can be expanded separately. In the last section, the result is displayed.