SHA-256有多少种组合? [英] How many combinations does SHA-256 have?
问题描述
通过使用在线工具和维基百科,我发现每个sha-256加密字符串都是64个字符长,包含数字和字符.因此,我假设存在34 ^ 36的组合(由代数计算器简化了2 ^ 216).经过研究,我发现大多数人说有2 ^ 256种组合.有人可以解释吗?为了使上下文更清晰,我写了一篇关于加密货币的论文,试图解释要加密多少种不同的组合,以及加密需要多长时间(因此需要多少猜测),并将其与加密中的总原子量进行比较.宇宙(大约10 ^ 85).
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).
推荐答案
SHA-256生成256位,即32个字节(不是字符),每个字节都有256个可能的值.
SHA-256 produces 256 bits which is 32 bytes, not characters, each byte has 256 possible values.
有256位,每个位有2个值(0或1),即2 ^ 256.
有32个字节,每个字节有256个值,即256 ^ 32.
注意:2 ^ 256 == 256 ^ 32〜= 10 ^ 77.
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.
可以用多种方式对32个字节进行编码,十六进制为64个字符,在Base64中为44个字符.
The 32 bytes can be encoded many ways, in hexadecimal it would be 64 characters, in Base64 it would be 44 characters.
这篇关于SHA-256有多少种组合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!