# Are there ANY text strings that will generate the same SHA-512 Hash output? [duplicate]

Are there ANY text strings that will generate the same SHA-512 Hash output? Please provide an example, and how you came to that conclusion.

I've tried thousands of variations, including ".." vs. "." and "..." vs "..,". I believe it IS possible, I just don't know HOW I can find those 2 magic text strings.

• Yes, but it's supposed to be hard to find an example. $\;$
– user991
Aug 28 '15 at 4:55
• You could do it, provided you checked all the possibilities. Count them, and you'll know. Aug 28 '15 at 5:07
• Typically similar strings will produce vastly different SHA hashes but it would be very interesting if there was a case where two similar strings produced the same hash Aug 28 '15 at 6:21
• Comments and answers use the phrase "hard to find". More accurate might be "possible in theory, but no-one has yet done it despite many attempts". Aug 28 '15 at 6:57
• Already answered at crypto.stackexchange.com/q/12301/351 and crypto.stackexchange.com/q/8765/351; see also crypto.stackexchange.com/q/301/351 and crypto.stackexchange.com/q/8092/351. In the future please make more of an effort to search for related questions here before posting a new one. Thank you!
– D.W.
Aug 28 '15 at 7:21

This is trivially true via the pigeonhole principle. SHA-2/512 has $2^{512}$ possible outputs, but $2^{2^{128}} - 1$ possible inputs. Trying $2^{512}+1$ unique inputs is sufficient to produce at least one collision.
• There isn't an infinite number of possible inputs. SHA-512 uses a 128 bit length field, which means it is undefined for inputs which are $2^{128}$ bits or longer. So the total number of possible inputs is $2^{2^{128}}-1$. Aug 28 '15 at 9:22