I was reading an Ars Technica article this morning and came across the following towards the end (emphasis mine):

Equation Group included six other hashes in different exploits that remain unknown at the moment. They appear to be generated by the SHA1 algorithm. They are:







How is it possible to deduce the algorithm used to generate a hash based on the bits of the hash alone? (Especially with respect to the SHA class of algorithms, which were intended to be cryptographically secure?)


You cannot, in full generality, infer the hash algorithm from the output. An output is just a sequence of bits, and hash functions that produce n-bit outputs can at least theoretically produce any sequence of n bits of output.

However, some people can make quick inferences (perhaps too quick), by saying that among the "usual" hash functions, only one produces 160-bit outputs, and that is SHA-1. (This notion of "usual" excludes RIPEMD-160, which, while rarer than SHA-1, is still widely used as part of PGP.)

IF, at some point in the future, we find a value x such that SHA-1(x) matches one of these hash values, then we will be pretty sure that SHA-1 was indeed involved, and on input x; any other hypothesis would mean that we have just broken SHA-1's preimage resistance, which is, as far as we know, out of our collective technological reach (unless we get very very lucky). However, until this is done, claiming that "this is SHA-1" is just guesswork.

| improve this answer | |

It's implied in the same article that Kaspersky has access to the code which uses the hashes. They know the algorithm because they have the code which generates it.

What they want to know is what the code is targeting which is hidden by the hash.

| improve this answer | |
  • It is not implied and they do not have the code. – kirelagin Aug 17 '16 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.