A sodium-browserify example for runtime.js
Clone the repo,
cd into it, then...
npm installnpm start# (make sure you have qemu-system-x86_64)
After a few seconds, qemu should appear! Wait about 3 seconds, and 3 numbers should appear, separated by comma, that's libsodium's randomness! Wait a bit more and you should see 'test' appear! That's a message that has been encrypted and decrypted by libsodium.
Of course, you can change
index.js to call any libsodium-wrappers function you want. Hack it all you want!
runtime-sodium-example uses a modified version of runtimeify (modifed version's link) that includes
runtime-node-crypto (in order to actually get libsodium working) combined with
runtimejs >= 0.1.25.