bitcoinsha256

How many combinations does SHA-256 have?


By using an online tool and wikipedia I found out that every sha-256 encrypted string is 64 chars longs containing numbers and characters. Hence I assumed that there are 34^36 combinations ( 2^216 simplified by an algebra calculator ). After doing some research I found out that most people said there are 2^256 combinations. Could someone explain ? To make the context clear, I write a paper about cryptocurrencies and try to explain how many different combinations there are to encrypt and how long this could take ( therefore how many guesses it could take) and compare this to the amount of total atoms in the universe (roughly 10^85).


Solution

  • SHA-256 produces 256 bits which is 32 bytes, not characters, each byte has 256 possible values.

    There are 256 bits and each bit has 2 values (0 or 1), thus 2^256.
    There are 32 bytes and each byte has 256 values, thus 256^32.
    Note: 2^256 == 256^32 ~= 10^77.

    The 32 bytes can be encoded many ways, in hexadecimal it would be 64 characters, in Base64 it would be 44 characters.