Photo by Марьян Блан | @marjanblan on Unsplash

Forget AES and ChaCha20, Here’s Encryption, Hashing and Integrity With a Sponge

--

Well. Just when you thought that symmetric key encryption was all about AES and ChaCha20, message signing (MAC) was all about HMAC, and that hashing was all about MD5, SHA-1, and SHA-256, Keccak comes along and shows the world a new direction. While designed for the NIST SHA-3 standard — and to produce a strong hashing method — Keccak has the potential to provide MACs (Message Authentication Code), hashes and symmetric key encryption, and in around 1,000 lines of code (compared to 600K lines of code for OpenSSL).

An outline of its operation is here:

So while it may seem obvious that Keccak can produce fixed length hashes (SHA3–224, SHA3–256, and so on) and variable length outputs (SHAKE-128 and SHAKE-256), it is not so obvious in its application to symmetric key encryption. For this we now take the key (K) and a nonce (N) to the absorption phase, and X-OR with r, and feed into f. This then creates the equivalent of a key stream for us then to X-OR with the message (M0, M1, and so on):

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.