This could fit into a lot of areas of SO but I feel like mathematics will know best.

What area of math is used for something like an MD5 or SHA algorithm?

Is there a mathematical equation/skeleton for something like it?


1 Answer 1


While I do not know what you mean by "mathematical equation/skeleton," to understand how MD5 is implemented, all you need to know is high school algebra, bit vector algebra (e.g., if A and B are two size $n$ bit vectors, what A XOR B, A AND B, etc. mean), plus the ability to read a simple computer program. Look at the sample code in the English-language Wikipedia entry for MD5.

When people talk about these algorithms, they often use the language of fields, vector spaces, and the like, from undergraduate algebra. They also use elementary probability reasoning.

Where prerequisites get hairier is for algorithms that use primes, factoring, etc., or, worse yet, elliptic curves, but things like MD5 are relatively simple.

  • $\begingroup$ I admit I don't know how to prove MD5 is hard to invert, isn't there a technical proof that it is not a bad cryptographic hash function and that inverting it would require solving a difficult problem (as the semi-prime factorization for RSA) ? $\endgroup$
    – reuns
    Apr 26, 2016 at 0:28
  • $\begingroup$ I do not know if anything can be proved in the way of reducing the inversion problem for MD5 to a known hard problem. Such a thing is not mentioned in tools.ietf.org/html/rfc6151, an overview of MD5's security. $\endgroup$
    – ForgotALot
    Apr 26, 2016 at 2:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .