Is there a hash function that satisfies all the following properties: 1. It is 1 to 1 (no collisions). 2. It can take any size input. 3. For any input, and some desired set of characters, there exists a third set characters that can be appended to the input so that the output starts with the desired characters. 4. All of the other usual requirements of a hash, like computationally infeasible de-hashing? This is a question that popped up from a CS problem I was thinking about, but this part seems more like math, so I asked it here as opposed to on Overflow.
2026-02-22 23:24:49.1771802689
Existence of a Perfect Cryptographic Hash Function
70 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
The hash functions I am familiar with return a fixed length hash, so cannot be one to one for arbitrary length input. One approach to meet your one to one and arbitrary length input would be to break the input into blocks of fixed length and hash each block. It is not hard to imagine a bijection on the bit strings of a fixed length that is computationally impractical to invert. You can use any block encryption algorithm if you can code it and forget the key. To be able to append text to get the possibility of a desired start to the output, just provide the output blocks in reverse order. As we have a bijection, there is some input block that creates any desired output block, though we don't know how to find it.