3 ms·
Except you can't encrypt with a hash function.
by p0nce 10y ago
Except you can't encrypt with a hash function.
- arethuza 10y agoI once saw that particular confusion in a security audit report that a company was using as part of their sales materials. I did flag it up as indicating that there might be something a bit fishy about the security audit if they made such an elementary error but I suspect the CEO (multi billion pound company) had already made the decision so what I thought was irrelevant :-)
- Chris2048 10y agoThis might be "fix my plumbing with a wrench", you can't, you also need a replacement pipe, but that wan't what was meant, more like "utilise a wrench in the fixing of my plumbing"...
- JoachimS 10y agoExactly.
- JoachimS 10y agoActually you can use a cryptographic hash function such as SHA-256 (or MD5, but lets not go there) as the core of a stream cipher. Basically stick a seed (key) combined with a counter as input to the hash functiom. Use the output as the keystream. Stream ciphers such as ChaCha are basically block based PRFs that operates like this. Of course the performance would be silly compared to dedicated functions. ChaCha20 has less than a third the number of iterations compared to SHA-256. And each iteration is much faster. Good thread: http://crypto.stackexchange.com/questions/48/is-it-feasible-to-build-a-stream-cipher-from-a-cryptographic-hash-function http://crypto.stackexchange.com/questions/48/is-it-feasible-...