What are the important points about cryptographic hash functions?

后端 未结 6 1372
生来不讨喜
生来不讨喜 2020-12-14 11:35

I was reading this question on MD5 hash values and the accepted answer confuses me. One of the main properties, as I understand it, of a cryptopgraphic hash function is tha

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 12:15

    You may be confused, because the answer to the question you cite is confusing. One of the requirements for a cryptographic hash function is that it should be preimage resistant. That is, if you know MD5(x) but not the message x, then it is difficult to find any x' (either equal x or different from x) such that MD5(x') = MD5(x).

    Being preimage resistant is a different property than being reversible. A function is reversible if given y = f(x) there is exactly one x which fits (whether this is easy or not). For example define f(x) = x mod 10. Then f is not reversible. From f(x) = 7 you can't determine whether x was 17, 27 or something else. But f is not preimage resistant, since values x' such that f(x) = 7 are easy to find. x' = 17, 27, 12341237 etc all work.

    When doing crypto you usually need functions that are preimage resistant (and other properties such as collision resistance), not just something that is not reversible.

提交回复
热议问题