{"_id":"sodium-prebuilt","_rev":"480994","name":"sodium-prebuilt","description":"Prebuilds for Lib Sodium port for node.js","dist-tags":{"latest":"1.0.22"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-08-05T09:37:02.000Z","created":"2015-07-26T15:18:33.382Z","1.0.22":"2016-03-01T03:54:53.435Z","1.1.0":"2015-07-26T15:43:09.777Z","1.0.19":"2015-07-26T15:18:33.382Z"},"users":{"bret":true},"author":{"name":"Pedro Paixao","email":"paixaop@gmail.com"},"repository":{"type":"git","url":"https://github.com/mafintosh/node-sodium-prebuilt"},"versions":{"1.0.22":{"name":"sodium-prebuilt","version":"1.0.22","author":{"name":"Pedro Paixao","email":"paixaop@gmail.com"},"license":"MIT","description":"Prebuilds for Lib Sodium port for node.js","dependencies":{"nan":"^2.0.9","prebuild":"^4.1.0"},"devDependencies":{"istanbul":">=0.2.6","mocha":">=0.14.1","mocha-istanbul":">=0.2.0","node-gyp":">=1.0.2","should":">=2.1.0"},"scripts":{"test":"make test","install":"prebuild --install --preinstall make","prebuild":"prebuild --all --preinstall make"},"repository":{"type":"git","url":"https://github.com/mafintosh/node-sodium-prebuilt"},"keywords":["encryption","ed25519","curve25519","NaCl","libsodium","crypto","unique","stamp"],"licenses":[{"type":"MIT","url":"http://opensource.org/licenses/mit-license.php"}],"gitHead":"a7a5c0d0c8f0869dcd3b4a7896f14cb2cb93a9b7","bugs":{"url":"https://github.com/mafintosh/node-sodium-prebuilt/issues"},"homepage":"https://github.com/mafintosh/node-sodium-prebuilt","_id":"sodium-prebuilt@1.0.22","_shasum":"f4c806f1e69b0b20c557959aeb3afb9defd53f46","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"f4c806f1e69b0b20c557959aeb3afb9defd53f46","size":2276044,"noattachment":false,"key":"/sodium-prebuilt/-/sodium-prebuilt-1.0.22.tgz","tarball":"http://registry.cnpm.dingdandao.com/sodium-prebuilt/download/sodium-prebuilt-1.0.22.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/sodium-prebuilt-1.0.22.tgz_1456804491741_0.7497016508132219"},"directories":{},"publish_time":1456804493435,"_cnpm_publish_time":1456804493435,"_hasShrinkwrap":false},"1.1.0":{"name":"sodium-prebuilt","version":"1.1.0","author":{"name":"Pedro Paixao","email":"paixaop@gmail.com"},"license":"MIT","description":"Lib Sodium port for node.js","dependencies":{"nan":">=1.6.2","prebuild":"^2.0.3"},"devDependencies":{"istanbul":">=0.2.6","mocha":">=0.14.1","mocha-istanbul":">=0.2.0","node-gyp":">=1.0.2","should":">=2.1.0"},"scripts":{"test":"make test","install":"prebuild --download"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/node-sodium-prebuilt.git"},"keywords":["encryption","ed25519","curve25519","NaCl","libsodium","crypto","unique","stamp"],"licenses":[{"type":"MIT","url":"http://opensource.org/licenses/mit-license.php"}],"gitHead":"7d84f2021a162e962062d9637a8f88e87a2499ef","bugs":{"url":"https://github.com/mafintosh/node-sodium-prebuilt/issues"},"homepage":"https://github.com/mafintosh/node-sodium-prebuilt#readme","_id":"sodium-prebuilt@1.1.0","_shasum":"14caf8890863e7c934bcd61784698ac3c0701f0c","_from":".","_npmVersion":"2.13.0","_nodeVersion":"2.4.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"14caf8890863e7c934bcd61784698ac3c0701f0c","size":1868422,"noattachment":false,"key":"/sodium-prebuilt/-/sodium-prebuilt-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sodium-prebuilt/download/sodium-prebuilt-1.1.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"publish_time":1437925389777,"_cnpm_publish_time":1437925389777,"deprecated":"defunkt version","_hasShrinkwrap":false},"1.0.19":{"name":"sodium-prebuilt","version":"1.0.19","author":{"name":"Pedro Paixao","email":"paixaop@gmail.com"},"license":"MIT","description":"Lib Sodium port for node.js","dependencies":{"nan":">=1.6.2","prebuild":"^2.0.3"},"devDependencies":{"istanbul":">=0.2.6","mocha":">=0.14.1","mocha-istanbul":">=0.2.0","node-gyp":">=1.0.2","should":">=2.1.0"},"scripts":{"test":"make test","install":"prebuild --download"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/node-sodium-prebuilt.git"},"keywords":["encryption","ed25519","curve25519","NaCl","libsodium","crypto","unique","stamp"],"licenses":[{"type":"MIT","url":"http://opensource.org/licenses/mit-license.php"}],"gitHead":"39d86217e0a6b25d5dd88d48d5f0b64a8f267b71","bugs":{"url":"https://github.com/mafintosh/node-sodium-prebuilt/issues"},"homepage":"https://github.com/mafintosh/node-sodium-prebuilt#readme","_id":"sodium-prebuilt@1.0.19","_shasum":"f77f7ca95af6e2d7dd0b674b88ff1c9a22fa1844","_from":".","_npmVersion":"2.13.0","_nodeVersion":"2.4.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"f77f7ca95af6e2d7dd0b674b88ff1c9a22fa1844","size":1867959,"noattachment":false,"key":"/sodium-prebuilt/-/sodium-prebuilt-1.0.19.tgz","tarball":"http://registry.cnpm.dingdandao.com/sodium-prebuilt/download/sodium-prebuilt-1.0.19.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"publish_time":1437923913382,"_cnpm_publish_time":1437923913382,"_hasShrinkwrap":false}},"readme":"[![Build Status](https://secure.travis-ci.org/paixaop/node-sodium.png)](http://travis-ci.org/paixaop/node-sodium)\n\n# node-sodium\n\nUses Libsodium 1.0.10\n\nPort of the [lib sodium](https://github.com/jedisct1/libsodium) Encryption Library to Node.js.\n\nAs of libsodium 1.0.10 all functions except memory allocation have been implemented.\nMissing functions are listed in [`docs/not implemented.md`](https://github.com/paixaop/node-sodium/blob/master/docs/not%20implemented.md).\n\n\nThere's a \"low level\" native module that gives you access directly to Lib Sodium, and a friendlier high level API that makes the library a bit easier to use.\n\nCheck [`docs/low-level-api.md`](https://github.com/paixaop/node-sodium/tree/master/docs/low-level-api.md) for a list of all lib sodium functions included in node-sodium.\n\n# Usage\n\nJust a quick example that uses the same public/secret key pair to encrypt and then decrypt the message.\n\n    var sodium = require('sodium');\n    var box = new sodium.Box();     // random key pair, and nonce generated automatically\n\n    var cipherText = box.encrypt(\"This is a secret message\", \"utf8\");\n    var plainText = box.decrypt(cipherText);\n\n\n# Low Level API\nA low level API is provided for advanced users. The functions available through the low level API have the exact same names as in lib sodium, and are available via the `sodium.api` object. Here is one example of how to use some of the low level API functions to encrypt/decrypt a message:\n\n    var sodium = require('sodium').api;\n\n    // Generate keys\n    var sender = sodium.crypto_box_keypair();\n    var receiver = sodium.crypto_box_keypair();\n\n    // Generate random nonce\n    var nonce = new Buffer(sodium.crypto_box_NONCEBYTES);\n    sodium.randombytes_buf(nonce);\n\n    // Encrypt\n    var plainText = new Buffer('this is a message');\n    var cipherMsg = sodium.crypto_box(plainText, nonce, receiver.publicKey, sender.secretKey);\n\n    // Decrypt\n    var plainBuffer = sodium.crypto_box_open(cipherMsg,nonce,sender.publicKey, receiver.secretKey);\n\n    // We should get the same plainText!\n    if (plainBuffer.toString() == plainText) {\n        console.log(\"Message decrypted correctly\");\n    }\n\nAs you can see the high level API implementation is easier to use, but the low level API will feel just right for those experienced with the C version of lib sodium. It also allows you to bypass any bugs in the high level APIs.\n\nYou can find this code sample in `examples\\low-level-api.js`.\n\n# Documentation\nPlease read the work in progress documentation found under [`docs/`](https://github.com/paixaop/node-sodium/tree/master/docs).\n\nYou should also review the unit tests as most of the high level API is \"documented\" there.\nDon't forget to check out the [examples](https://github.com/paixaop/node-sodium/tree/master/examples) as well.\n\nThe low level `libsodium` API documentation is now complete. All ported functions have been documented in [low-level-api.md](./docs/low-level-api.md) with code examples.\n\nPlease be patient as I document the rest of the APIs, or better still: help out! :)\n\n# Lib Sodium Documentation\nLib Sodium is documented [here](http://doc.libsodium.org/). Node-Sodium follows the same structure and I will keep documenting it as fast as possible.\n\n# Install\n\nTested on Mac, Linux, Windows and IllumOS Systems\n\n    npm install sodium\n\nnode-sodium depends on libsodium, so if libsodium does not compile on your platform chances are `npm install sodium` will fail.\n\nInstallation will fail if `node-gyp`is not installed on your system. Please run\n\n    npm install node-gyp -g\n\nBefore you install `node-sodium`. If you run into permission errors while installing `node-gyp` run as Adminstrator on Windows or use `sudo` in other OSes.\n\n\tsudo npm install node-gyp -g\n\n## Windows Install\n\nWindows installs will automatically attempt to download LibSodium binary distribution, and include files, from [my repo](https://github.com/paixaop/libsodium-bin).\nYou MUST set the `msvs_version` `npm config` variable to the appropriate Microsoft Visual Studio version you have installed before you run `npm install` on Windows.\n\nExample set `msvs_version` for your user only:\n\n    npm config set msvs_version 2015\n\nExample set `msvs_version` for all users:\n\n    npm config set msvs_version 2015 --global\n\nAt the moment only 2010, 2012, 2013 and 2015 versions are supported.\n\nNow run\n\n    npm install\n\nAt the moment Windows only supports dynamic linking so you must have the `libsodium.dll` in the same directory\nas `sodium.node`. This is done automatically by the install script, but if you move things around manually\nplease don't forget to copy the DLL file as well.\n\n# Manual Build\n\nNode Sodium includes the source of libsodium, so the normal install will try to compile libsodium directly from source, using libsodium's own build tools.\nThis is the prefered method of compiling node sodium.\nIf you can't compile libsodium from source in your platform you can [download a pre-compiled binary](http://www.libsodium.org/releases) and copy the libsodium.* library files to `./deps/build/lib` folder.\nand copy all the include files to `./deps/build/include`.\n\nBefore you run the manual build you must run the `npm install` once to install the required dependencies, like `node-gyp` that are needed to compile `node-sodium`.\nPlease note that `npm install` will install the dependencies and compile `node-sodium` as well. After this initial step you can make changes to the source and run the following commands to manually build the module:\n\n    make sodium\n\n# SECURITY WARNING: Using a Binary LibSodium Library\n\nNode Sodium is a strong encryption library, odds are that a lot of security functions of your application depend on it, so *DO NOT* use binary libsodium distributions that you haven't verified.\nIf you use a pre-compiled version of libsodium you MUST be sure that nothing malicious was added to the compiled version you are using.\n\nThe Windows installation uses an official binary distribution that I maintain at [my repo](https://github.com/paixaop/libsodium-bin).\nThe files in this repository correspond to the files for the [MSVC libsodium build](http://www.libsodium.org/releases) version supported by node-sodium.\nI will keep them updated as newer versions of libsodium become available and are supported by node-sodium.\n\nThese are provided in an attempt to simplify Windows installs and you should verify the file signatures against the originals, to make sure they haven't been\ntampered with. They are provided AS IS and I take no responsibility for their correctness.\n\n# Code Samples\nPlease check the fully documented code samples in `test/test_sodium.js`.\n\n# Installing Mocha Test Suite\n\nTo run the unit tests you need Mocha. If you'd like to run coverage reports you need mocha-istanbul. You can install both globally by doing\n\n    npm install -g mocha mocha-istanbul\n\nYou may need to run it with `sudo` as only the root user has access to Node.js global directories\n\n    sudo npm install -g mocha mocha-istanbul\n\n# Unit Tests\nYou need to have mocha test suite installed globally then you can run the node-sodium unit tests by\n\n    make test\n\n# Coverage Reports\nYou need to have mocha and mocha-istanbul installed globally then you can run the node-sodium coverage reports by\n\n    make test-cov\n\n\n# License\nThis software is licensed through the MIT License. Please read the LICENSE file for more details.\n\n# Author\n\nBuilt and maintained by Pedro Paixao\n","_attachments":{},"homepage":"https://github.com/mafintosh/node-sodium-prebuilt","bugs":{"url":"https://github.com/mafintosh/node-sodium-prebuilt/issues"},"license":"MIT"}