5
3
Bitcoin uses both SHA-256 and RIPEMD-160 hashes. Most often a double-round SHA-256 is used, but for address generating, RIPEMD-160 is used because it generates a shorter hash value. RIPEMD-160 has a 160-bit or 20-byte hash value while SHA-256 has a 256-bit or 32-byte.
So RIPEMD-160 is used for it's shorter hash. However, SHA-1 also produces a 160-bit hash. RIPEMD-160 is a less popular algorithm but in fact achieves exactly the same as SHA-1 does.
The only real difference I can find on the internet is in the following fragment from RIPEMD-160's Wikipedia page:
RIPEMD-160 was designed in the open academic community, in contrast to the NSA designed SHA-1 and SHA-2 algorithms. On the other hand, RIPEMD-160 appears to be used somewhat less frequently than SHA-1, which may have caused it to be less scrutinized than SHA. RIPEMD-160 is not known to be constrained by any patents.
Are patent issues the reason? Why is SHA-1 a problem but SHA-256 not? I know that SHA-1 and SHA-2 (of which SHA-256 is a part) are different iterations of the SHA initiative and so probably have very different legal implementation.
Does anyone really knows why RIPEMD-160 was chosen before the more popular SHA-1?
Only the first is really an argument. The other two can be refuted by the fact that SHA-256 is used instead of another 256-bit hash. SHA-256 is probably chosen for it's popularity, so why wouldn't SHA-1 be chosen for the same reason? – Steven Roose – 2013-11-11T13:37:07.167
I don't quite agree. Just because one of the algorithms (SHA-256) is NSA-designed, doesn't mean that it still isn't a benefit to use an algorithm designed by another institution. – liamzebedee – 2013-11-11T23:16:30.417
1 – liamzebedee – 2013-11-11T23:22:10.393
It is worth noting that Satoshi could've used SHA2-256 twice and truncated the second digest to 160 bits. The fact that he didn't I think is some evidence to show that Satoshi's decision was a conscious decision to use RIPEMD-160 over the NSA suit of algorithms.
(http://crypto.stackexchange.com/questions/3153/sha-256-vs-any-256-bits-of-sha-512-which-is-more-secure)
I don't say that he should have used SHA-1 because it's NSA-designed. Just saying that it's weird that he uses SHA-256 for a 256-bit hash but RIPEMD-160 for a 160-bit hash while the same family of hashes that SHA-256 is in has a 16-bit variant as well. (I know that SHA-1 and SHA-2 are not entirely from the same family, but they share the same name..) – Steven Roose – 2013-11-12T02:08:29.323