{"name":"sodium-javascript","version":"0.3.1","description":"WIP - a pure javascript version of sodium-native","main":"index.js","dependencies":{"blake2b":"^2.1.1","nanoassert":"^1.0.0","siphash24":"^1.0.1"},"devDependencies":{"sodium-test":"^0.4.0"},"scripts":{"test":" node test.js"},"browserify":{"transform":["brfs"]},"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":"abedfa6362fdfbc5e3ee93c6a89f52de45a60824","_id":"sodium-javascript@0.3.1","_npmVersion":"5.0.3","_nodeVersion":"8.1.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-2uSssD4aJ7OmUdeG5vtdLJQyM2oGniUUEYW1XM+kQt4c3OXytOKmX6UIpae9Dviqx9DutNwF6U0VrMqDE19bfQ==","shasum":"534669f81c89d66f728ec10a58ef9c7543b7532a","tarball":"http://registry-npm.ywwl.com/sodium-javascript/download/sodium-javascript-0.3.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDk3jtSdkgFMDcnrp9QXvBUji3nGiOBYwObi9/W8LMB4AIhANS+T7iMkrkAxiLU+csVEBwnUf7kWxRW+KQQrPHhAzQ5"}],"size":15524,"noattachment":false,"key":"/sodium-javascript/-/sodium-javascript-0.3.1.tgz"},"maintainers":[{"email":"github@tixz.dk","name":"emilbayes"},{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sodium-javascript-0.3.1.tgz_1497258100413_0.8949746896978468"},"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":1497258102003,"_cnpm_publish_time":1497258102003,"dist-tags":{"latest":"0.8.0"}}