| ▲ | tptacek 4 hours ago | |||||||||||||||||||||||||
The right way to understand modern general-purpose cryptographic hash functions (like SHA2) is just to understand block ciphers. A hash function is a block cipher's permutation core, wired to a "compression" function (much simpler than compression as typically understood; somewhat analogous to the chaining CBC does) that feeds blocks through the same permutation continuously, scrambling state as it goes. Everything gets tweaked differently because you have different constraints and parameters for a hash function than for a block cipher (though: there were SHA3 contestants that used Rijndael/AES for the core permutation, which is attractive because it has broad hardware support), but the core doodads are basically the same. (And of course, you can run this argument in reverse and derive a cipher from a hash function trivially. That's how Chapoly happened.) | ||||||||||||||||||||||||||
| ▲ | ksenzee 3 hours ago | parent [-] | |||||||||||||||||||||||||
> just to understand block ciphers I have a decent intuition for what a hash function does after twenty years of encountering them in the wild. I don't even know what a block cipher is. I understand hash functions less after reading this than I did before. My conclusion is that a hash function is just a block cipher in the category of endofunctors. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||