{"_id":"chloridedown","_rev":"3-b7cb283ecf0047720f1f70f295db275c","name":"chloridedown","description":"Lib Sodium port for node.js","dist-tags":{"latest":"1.0.22"},"versions":{"1.0.22":{"name":"chloridedown","version":"1.0.22","author":{"name":"Pedro Paixao","email":"paixaop@gmail.com"},"license":"MIT","description":"Lib Sodium port for node.js","dependencies":{"nan":"^2.0.9"},"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","preinstall":"make","install":"node-gyp rebuild"},"repository":{"type":"git","url":"git+https://github.com/paixaop/node-sodium.git"},"keywords":["encryption","ed25519","curve25519","NaCl","libsodium","crypto","unique","stamp"],"licenses":[{"type":"MIT","url":"http://opensource.org/licenses/mit-license.php"}],"gitHead":"6e385b2c2eee988f01e71e85eb6a4837611400eb","bugs":{"url":"https://github.com/paixaop/node-sodium/issues"},"homepage":"https://github.com/paixaop/node-sodium#readme","_id":"chloridedown@1.0.22","_shasum":"b19624436c94935af3d195c3cf4a9a4cd9d12b55","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"dist":{"shasum":"b19624436c94935af3d195c3cf4a9a4cd9d12b55","tarball":"https://registry.npmjs.org/chloridedown/-/chloridedown-1.0.22.tgz","integrity":"sha512-ffidK7sArBwU6KyV5Bk4HY9Y1hi8u1mgGandgRBTsdJxess4FxvMpdeJrI/E3mKfUlfUFypbdcZZC13ENrmb1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQy+e+JvGGnwBXPFHj3AnxJVsWnooYNq8JxKZYhIpfYwIhAPDjQXrdNbqNia4WzM1HCzTUt5P5TA7aDVwO6bVjv66W"}]},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}]}},"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.3\n\nPort of the [lib sodium](https://github.com/jedisct1/libsodium) Encryption Library to Node.js.\n\nThis a work in progress but most of Lib Sodium as been ported already.\nMissing are the `generichash` functions, and the alternative primitives, like `crypto_box_curve25519xsalsa20poly1305`, or `crypto_stream_aes128ctr`\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 use of the library a bit easier.\n\nCheck [`docs/ported-functions.md`](https://github.com/paixaop/node-sodium/tree/master/docs/ported-functions.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\t// Generate random nonce\n    var nonce = new Buffer(sodium.crypto_box_NONCEBYTES);\n\tsodium.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    // 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 fill just right for those with experience 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 shoudld also review the unit tests as most of the high level API is \"documented\" there.\nDon't forget to check out the 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 and IllumOS Systems\n\n    npm install sodium\n    \nnode-sodium depends on lib sodium, so if lib sodium does not compile on your platform chances are `npm install sodium` will fail.\n\n# Manual Build\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 configure\n    make sodium\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` is only 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 test suite installed globally then you can run the node-sodium unit tests by\n\t\n    make test-cov\n\t\n\n# License\nThis software is licensed thorugh MIT License. Please read the LICENSE file for more details.\n\n# Author\n\nBuilt and maintained by Pedro Paixao\n","maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"time":{"modified":"2022-06-13T05:58:59.138Z","created":"2015-12-05T05:49:53.941Z","1.0.22":"2015-12-05T05:49:53.941Z"},"homepage":"https://github.com/paixaop/node-sodium#readme","keywords":["encryption","ed25519","curve25519","NaCl","libsodium","crypto","unique","stamp"],"repository":{"type":"git","url":"git+https://github.com/paixaop/node-sodium.git"},"author":{"name":"Pedro Paixao","email":"paixaop@gmail.com"},"bugs":{"url":"https://github.com/paixaop/node-sodium/issues"},"license":"MIT","readmeFilename":"README.md"}