I'm a newbie to Cryptography. I'm learning about SHA-256 hash function now and I wish to have an overall look on it. What are its advantages and disadvantages comparing to other hash functions, like X11, Scrypt,...?
-
$\begingroup$ Advantages and disadvantages are determined by use case. It is not possible to answer this question without knowing what exactly you intend to hash and why. There are articles out there that discuss them in the context of cryptocurrencies/proof of work; Is that your use case? $\endgroup$– Ella RoseCommented Feb 18, 2017 at 3:29
-
12$\begingroup$ The chief advantage that SHA-256 has over Scrypt is that it is far more efficient. The chief disadvantage that SHA-256 compared to Scrypt is that it is far more efficient. $\endgroup$– ponchoCommented Feb 18, 2017 at 4:49
-
4$\begingroup$ If memory serves me well there are a few more differences, I think you should take above funny comment with a grain of salt ;) $\endgroup$– Maarten Bodewes ♦Commented Feb 18, 2017 at 17:20
1 Answer
All three of the hashes you list serve very different purposes. Asking what their relative advantages and disadvantages ar is like asking about the same about a screwdriver, hammer, and drill.
SHA-2 is a cryptographic hash function, and is typically a building block for other cryptographic constructs. In satisfying the requirements of cryptographic hash, it's a one-way function that is deterministic, fast to compute, resistant to pre-image and second-preimage attacks, and is collision resistant.
scrypt is a password-based key derivation function. It's used to turn a low-entropy password into a cryptographic key or verifier with effectively higher entropy by being intentionally slow to compute. It's tunable to require larger amounts of CPU and/or memory as technology advances, making hardware dedicated to computing it en masse expensive.
X11 from what I can gather is a proof-of-work function for blockchain-based currencies. It appears to be little more than inelegantly mashing of a bunch of unrelated hash functions together in the naïve hope that that will somehow make it ASIC-resistant and more secure. I don't think it's received any analytic attention from cryptographers.