SHA-2 (Secure Hash Algorithm 2), which includes SHA-256, is among the most widely used hashing algorithms today. Renowned for its security—unlike SHA-1, which has been compromised—SHA-2 is also noted for its speed. This makes it particularly effective in scenarios where key generation isn't required, such as Bitcoin mining, where a fast hash algorithm like SHA-2 is highly advantageous.
The SHA-256 compression function op erates on a 512-bit message block and a 256- bit intermediate hash value. It is essentially a 256-bit blo ck cipher algorithm which encrypts the intermediate hash value using the message blo ck as key. Hence there are two main comp onents to describe: (1) the SHA-256 compression function, and (2) the SHA-256 message schedule.
- Pre-Processing
- Initialize Hash Values (h)
- Initialize Round Constants (k)
- Chunk Loop
- Create Message Schedule (w)
- Compression
- Modify Final Values
- Concatenate Final Hash