Hacker News new | ask | show | jobs
by SAI_Peregrinus 2353 days ago
To be excessively pedantic you can encrypt securely (but slowly for the SHA series) with a hash function of sufficient capacity by running the hash function in CTR mode. You turn it into a stream cipher. Ideally you also MAC the ciphertext, nonce, and other associated data. That's is pretty easy with such a hash function (either use HMAC or a MAC mode of the hash function if supported).

Salsa20 & ChaCha20 cores are hash functions (though not collision-resistant compression functions since it's not needed for their design goal and would be slower) run in CTR mode.[1]

[1] https://cr.yp.to/salsa20.html

1 comments

> To be excessively pedantic

This is the best, most delicious, type of pedantry friend!

You're the best kind of pedantry friend!

(Just some more pedantry, friend.)

Ok man, now that's just over the top.

/s