Plaintext(binary) : 10101100 //very short for easy understanding
Suppose we have 4 predefined schemes/functions,
- rotate (101 -> 011)
- flip (1101 -> 1011)
- exchange (11011 -> 10111)
- stretch (1100 -> 11001100)
We create a function that checks for '0' or '1' in each position of plaintext(binary)
function in simple terms, (suppose plaintext in binary 10101100)
- Bit at position 1 is 1, so perform rotate() on plaintext.
- Bit at position 2 is 0, don't perform flip() operation.
- Bit at position 3 is 1, so perform exchange() on output of step 1.
- Bit at position 4 is 0, don't perform stretch operation.
- Bit at position 5 is 1, so perform rotate() on output of step 3.
- Bit at position 6 is 1, so perform flip() on output of step 5.
- Bit at position 7 is 0, don't perform exchange().
- Bit at position 8 is 0, don't perform stretch().
In this the output would be dependent on the input, hence it may serve as a hash to the plaintext. These functions are just for example, more complex functions may be used. I've used just 4 functions however more functions can be used.
I don't know if this is already the logic in existing hashing schemes but had this thought in mind. Will this work as a proper hashing scheme? (I suppose no)