{"name":"sodium-javascript","version":"0.0.1","description":"WIP - a pure javascript version of sodium-native","main":"index.js","dependencies":{"blakejs":"^1.0.1"},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sodium-javascript.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sodium-javascript/issues"},"homepage":"https://github.com/mafintosh/sodium-javascript","gitHead":"709001fd4e2d50393e7c22aac1cfc048d622aeba","_id":"sodium-javascript@0.0.1","scripts":{},"_shasum":"2e708b5d03d9add8b685014df7aaf90b863cd448","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"2e708b5d03d9add8b685014df7aaf90b863cd448","tarball":"http://registry-npm.ywwl.com/sodium-javascript/download/sodium-javascript-0.0.1.tgz","integrity":"sha512-N9Emtj5Y9LEaaoSYVusMM+cECtzddSmUkOpD2yZBaFt49IGBsu8Xojt09/fxSJZMI1DJNOpEBNTgtigmg+Zwpw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHOTJmA79Kibbq2k0s3QkJZTunUkKPG4bGPoXaRTDufWAiEAngmhtwSOogEEan91OUt/0YT0Rbb5QGrYVELMHI8Ba8Q="}],"size":14475,"noattachment":false,"key":"/sodium-javascript/-/sodium-javascript-0.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sodium-javascript-0.0.1.tgz_1486867092241_0.2710914097260684"},"directories":{},"readme":"# `sodium-javascript`\n\n[![Build Status](https://travis-ci.org/sodium-friends/sodium-javascript.svg?branch=master)](https://travis-ci.org/sodium-friends/sodium-javascript)\n\n> WIP - a pure javascript version of [sodium-native](https://github.com/sodium-friends/sodium-native).\nBased on tweetnacl\n\n## Usage\n\n``` js\nconst sodium = require('sodium-javascript')\n\nconst key = Buffer.alloc(sodium.crypto_secretbox_KEYBYTES)\nconst nonce = Buffer.alloc(sodium.crypto_secretbox_NONCEBYTES)\n\nsodium.randombytes_buf(key)\nsodium.randombytes_buf(nonce)\n\nconst message = Buffer.from('Hello, World!')\nconst cipher = Buffer.alloc(message.length + sodium.crypto_secretbox_MACBYTES)\n\nsodium.crypto_secretbox_easy(cipher, message, nonce, key)\n\nconsole.log('Encrypted:', cipher)\n\nconst plainText = Buffer.alloc(cipher.length - sodium.crypto_secretbox_MACBYTES)\n\nsodium.crypto_secretbox_open_easy(plainText, cipher, nonce, key)\n\nconsole.log('Plaintext:', plainText.toString())\n```\n\n## API\n\nSee [sodium-native](https://github.com/sodium-friends/sodium-native).\nThis is a work in progress so not all functions are implemented yet.\n\nThis module is organised into individual submodules which can be required\nindependently for smaller bundles in the browser. To leverage automatic\nswitching between `sodium-javascript` and `sodium-native`, see\n[`sodium-universal`](https://github.com/sodium-friends/sodium-universal).\n\n## Install\n\n```\nnpm install sodium-javascript\n```\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1486867094218,"_cnpm_publish_time":1486867094218,"dist-tags":{"latest":"0.8.0"}}