Do cryptographic hash functions reach each possible values, i.e., are they surjective?

后端 未结 5 2043
谎友^
谎友^ 2021-01-31 03:48

Take a commonly used binary hash function - for example, SHA-256. As the name implies, it outputs a 256 bit value.

Let A be the set of all possible 256 bit bina

5条回答
  •  我在风中等你
    2021-01-31 04:03

    It really depends on the hash function. If you use this valid hash function:

    Int256 Hash (string input) {
        return 0;
    }
    

    then it is obvious that C != A. So the "for example, SHA256" is a pretty important note to consider.

    To answer your actual question: I believe so, but I'm just guessing. Wikipedia does not provide any meaningful info on this.

提交回复
热议问题