Can a SHA-1 hash be all-zeroes?

后端 未结 7 873
[愿得一人]
[愿得一人] 2021-02-05 02:17

Is there any input that SHA-1 will compute to a hex value of fourty-zeros, i.e. \"0000000000000000000000000000000000000000\"?

7条回答
  •  死守一世寂寞
    2021-02-05 02:50

    The post by Aaron is incorrect. It is getting hung up on the internals of the SHA1 computation while ignoring what happens at the end of the round function.

    Specifically, see the pseudo-code from Wikipedia. At the end of the round, the following computation is done:

    h0 = h0 + a
    h1 = h1 + b 
    h2 = h2 + c
    h3 = h3 + d
    h4 = h4 + e
    

    So an all 0 output can happen if h0 == -a, h1 == -b, h2 == -c, h3 == -d, and h4 == -e going into this last section, where the computations are mod 2^32.

    To answer your question: nobody knows whether there exists an input that produces all zero outputs, but cryptographers expect that there are based upon the simple argument provided by daf.

提交回复
热议问题