0
$\begingroup$

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?

$\endgroup$
3
  • $\begingroup$ Thanks, Pieter. Any technical resources you can point me toward? $\endgroup$
    – rkoni
    Commented Dec 22, 2021 at 2:12
  • 1
    $\begingroup$ Related: crypto.stackexchange.com/questions/15953/… $\endgroup$ Commented Dec 22, 2021 at 4:04
  • $\begingroup$ A similar question asked for MD5. Although the algorithms're different, their mechanisms are roughly the same. $\endgroup$
    – DannyNiu
    Commented Dec 22, 2021 at 8:02

0