# What is the critical importance of SHA and other hash families? [closed]

Assume integer factoring, discrete log are classical safe and LWE, McEliece etc are quantum safe. This question is only about SHA and hash families in general on why we need them if we have pkc primitives.

1. What role does SHA256 or other hash families play? Why are they needed when we have LWE, McEliece etc?

2. What happens if only SHA2 family including SHA256 is broken? Will we still have online finance and the internet?

• What you're questioning is the value of what can be considered one of the foundational component of modern cryptography. Jun 14 at 5:56
• @DannyNiu So without hash functions we will not have modern crypto even if LWE was secure? Jun 14 at 17:16
• Well, it's not that absolute. I mean, if you have reality distortion field like great entrepreneurs such as Steve Jobs, then you can make modern cryptography radically different; if you don't, then JUST LEARN, before asking underthought questions like this one. Jun 15 at 0:52
• I'm voting to close this question as needing details now, as you haven't explained why you believe hash functions are redundant, or proposed alternative constructions that can fill in on its role. Jun 15 at 0:55
• @DannyNiu " why you believe hash functions are redundant".. that's exactly the question here. Jun 15 at 15:47

## 1 Answer

1. What role does SHA256 or other hash families play?

A cryptographic hash function (such as SHA256) takes an arbitrary long input, and converts it into a fixed length string such that:

• Given an output of a hash, it is hard to find an input that hashes to that ("preimage resistance")

• Given a string, it is hard to find a different input where both inputs hash to the same value ("second preimage resistance")

• It is hard to find two different inputs that hash to the same value ("collision resistance")

A hash function is a quite useful tool when creating larger cryptographical objects. The standard example is signing: public key signature algorithms typically can't take arbitrary length inputs, while we might want to sign quite large objects. What we do is apply the hash function to the object, and have the actual public key algorithm sign the hash - because it is hard to find a second object that hashes to the same value, then we know that if the signature verifies (and the hash is what it was originally), we know that it also must be the original large object.

Why are they needed when we have LWE, McEliece etc?

That we very much a "why do we need screwdrivers when we have hammers" - it's because they serve different functions

1. What happens if only SHA2 family including SHA256 is broken? Will we still have online finance and the internet?

Well, that's actually happened before; with both MD5 and SHA-1, collision resistance has been broken - the industry migrated to other hash functions (chiefly SHA-2). What we'd do is migrate again, probably to SHA-3 (which is quite different internally - it is quite unlikely that the same cryptographic finding would apply to both SHA-2 and SHA-3)

• so if we don't have hash functions, we cannot verify signatures and therefore we can break the internet? Jun 13 at 21:13
• ".. that's actually happened before; with both MD5 and SHA-1,".. my question is what if we dont have hash functions at all or not use them at all? can we still have internet and digital finance? Jun 15 at 15:52
• @Turbo: well, if we have one way functions, we are likely to be able to create a hash function (although possibly not ones as efficient as the hash functions we currently use) If we don't have a one way function, well, it turns out that we don't have any computation cryptography... Jun 15 at 15:57
• I see. Assume factoring or LWE is a OWF. How would one create a hash function from this? Jun 15 at 23:46
• @Turbo: well, one way functions aren't all that far from things that act like random oracles (that is, if we have one, we're likely to have the other), and once we have something that acts like a random oracle, we have hash functions. This is not a proof - hence of my use of "likely" Jun 19 at 14:18