{"name":"sodium-javascript","version":"0.0.0","description":"WIP - a pure javascript version of sodium-native","main":"index.js","dependencies":{},"devDependencies":{},"repository":{"type":"git","url":"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":"e54c674afc1e02ba8212f1811cbb9bca6d16c2f1","_id":"sodium-javascript@0.0.0","scripts":{},"_shasum":"abac90114a645dd7fc04fdda6d309f91e2260454","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"abac90114a645dd7fc04fdda6d309f91e2260454","tarball":"http://registry-npm.ywwl.com/sodium-javascript/download/sodium-javascript-0.0.0.tgz","integrity":"sha512-rLKMq5A2find34dAAcYOL+q/qqPkFToa9CmtTUq4Jfpr/dO6rc2AbkfhgOLv/2ZDmP3x3J/+NCvIQengaTanFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTDiHVPxd/KvYQPbVnVcCH5sjIMGoWQjGgvVwpGud0LgIhALkoWAotfNhxceTllbgxBHzURm9iSP5+o6x6ceukC4JL"}],"size":14294,"noattachment":false,"key":"/sodium-javascript/-/sodium-javascript-0.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/sodium-javascript-0.0.0.tgz_1485254553144_0.40830633230507374"},"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":1485254553722,"_cnpm_publish_time":1485254553722,"dist-tags":{"latest":"0.8.0"}}