Skip to main content
Post Closed as "Duplicate" by Meir Maor, kelalaka, Maarten Bodewes
Post Migrated Here from bitcoin.stackexchange.com (revisions)
Source Link
rkoni
rkoni

Why does SHA2 work?

I was reading how bitcoin uses sha2

I understand how sha2 works procedurally (i.e. https://qvault.io/cryptography/how-sha-2-works-step-by-step-sha-256/), but I have no clue why it works.

Steps like s0 = w[i-15] right rotate 7 xor w[i-15] right rotate 18 xor ... look completely arbitrary.

Can someone given an intuitive explanation why this algorithm works? More specifically, how are the right rotate numbers chosen, why is right rotate used, why is xor used, etc?