4 ms·
It was an implementation of Trivium, an extremely simple stream cipher. I was also thinking of doing Salsa20, but I got distracted. The code: http://basecase.o
by celoyd 16y ago
It was an implementation of Trivium, an extremely simple stream cipher. I was also thinking of doing Salsa20, but I got distracted.
The code: http://basecase.org/trivium/trivium.js http://basecase.org/trivium/trivium.js
Demo: http://basecase.org/trivium/ http://basecase.org/trivium/
Honestly, I lost interest once I got it working with simple test strings. If you do something cool with it, let me know!
Edit: Looking at it again, my code is badly undercommented – sorry. But if you follow along with the Trivium specification (http://www.ecrypt.eu.org/stream/ciphers/trivium/trivium.pdf http://www.ecrypt.eu.org/stream/ciphers/trivium/trivium.pdf), which is a model of clarity, it should all make sense mod renaming of variables etc. The outstanding bug is that it assumes that any sequence of 16-bit values can be taken as a UTF-16 string, which is not true. Will e-mail you some general thoughts when I have a few minutes.