I read this interesting question on why improvising your own Hash function out of existing hash functions is bad. However this is specifically focusing on 'mixing' existing hashfunctions. What if for instance, I modify the per-round shifts of the MD5 hashfunction? Example:
Shifts rounds as of now
s[ 0..15] := { 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22 }
s[16..31] := { 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20 }
s[32..47] := { 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23 }
s[48..63] := { 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21 }
My own slightly adjusted shift rounds
s[ 0..15] := { 5, 14, 19, 22, 5, 14, 19, 22, 5, 14, 19, 22, 5, 14, 19, 22 }
s[16..31] := { 6, 12, 14, 21, 6, 12, 14, 21, 6, 12, 14, 21, 6, 12, 14, 21 }
s[32..47] := { 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23 }
s[48..63] := { 7, 9, 11, 17, 7, 9, 11, 17, 7, 9, 11, 17, 7, 9, 11, 17 }
These changes change the outcome of my 'own' hashfunction drastically. This is just one small example to change. My reasoning behind this is that it temporarily prevents Rainbow attacks. If I have some sloppy users with passwords like thisisnopassword
, pandabear
& 12346
they would be sligtly safer after my database would be hacked as no Rainbow tables exist for 'my' hash.
By the way, I chose the per-round shift amounts is because I couldn't find a clear rationale on why they were specifically chosen, see this question.