{"_id":"sodium-encryption","_rev":"10-785af2d4815d4d82e5925240a06fb4ad","name":"sodium-encryption","description":"Sodium encryption that works in node and in the browser","dist-tags":{"latest":"1.2.3"},"versions":{"1.0.0":{"name":"sodium-encryption","version":"1.0.0","description":"Sodium encryption that works in node and in the browser","main":"index.js","dependencies":{"tweetnacl":"^0.14.1","sodium-prebuilt":"^1.0.22"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"browser":"./browser.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sodium-encryption.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sodium-encryption/issues"},"homepage":"https://github.com/mafintosh/sodium-encryption","optionalDependencies":{"sodium-prebuilt":"^1.0.22"},"gitHead":"98fbaf251c7e1d82c6eea2e9565a5337e58c06a9","_id":"sodium-encryption@1.0.0","_shasum":"b0bba385a56a199588cdf207f8861ad5aa873951","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"b0bba385a56a199588cdf207f8861ad5aa873951","tarball":"https://registry.npmjs.org/sodium-encryption/-/sodium-encryption-1.0.0.tgz","integrity":"sha512-r6RBD4zZ9iqcskx2SIv85CY1lliNxs3pcPx9zmsFNZm81gPaTh8tIBbWGJ4Nmm6hhX82NKeEH86BVVuLwyxCiQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYHxx64aboCFln+I0FEQzzitQzNRcaNTuU3QkfBj6cUAIhAP04j5mm6dybaaUNuWUuQyk1GdnAUT4uQL3n/a2wOxBp"}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sodium-encryption-1.0.0.tgz_1457610176774_0.7114700668025762"}},"1.0.1":{"name":"sodium-encryption","version":"1.0.1","description":"Sodium encryption that works in node and in the browser","main":"index.js","dependencies":{"tweetnacl":"^0.14.1","sodium-prebuilt":"^1.0.22"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"browser":"./browser.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sodium-encryption.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sodium-encryption/issues"},"homepage":"https://github.com/mafintosh/sodium-encryption","optionalDependencies":{"sodium-prebuilt":"^1.0.22"},"gitHead":"080f7054dd9a86f37cd6c4d1f34652c7dd363302","_id":"sodium-encryption@1.0.1","_shasum":"a374070c8e6a74a005d7f9a71d46df1b63f61d65","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"a374070c8e6a74a005d7f9a71d46df1b63f61d65","tarball":"https://registry.npmjs.org/sodium-encryption/-/sodium-encryption-1.0.1.tgz","integrity":"sha512-JH4o0hLXu7wgjuehCFUT38Behfiww2PRAfsbma/rkRZc+DubFSnn0MbIyNtoi7DFjPwKJRULwgd1lsV52rUq5w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvMTVcEyqQRb5vDe11tPAJDZyUy84jsfjesIqOq2SxpAiEAzC8ogelN+Ds5vmQ/57pM4Z4bKaL0I92nmmyS1kRwtsU="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/sodium-encryption-1.0.1.tgz_1457610492190_0.08270715130493045"}},"1.1.0":{"name":"sodium-encryption","version":"1.1.0","description":"Sodium encryption that works in node and in the browser","main":"index.js","dependencies":{"tweetnacl":"^0.14.1","sodium-prebuilt":"^1.0.22"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"browser":"./browser.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sodium-encryption.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sodium-encryption/issues"},"homepage":"https://github.com/mafintosh/sodium-encryption","optionalDependencies":{"sodium-prebuilt":"^1.0.22"},"gitHead":"863361d19731775667be6ccea042979c25f57da7","_id":"sodium-encryption@1.1.0","_shasum":"f3afd00c5ae5ec9c953430cd560c3b4504ba0d9a","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"f3afd00c5ae5ec9c953430cd560c3b4504ba0d9a","tarball":"https://registry.npmjs.org/sodium-encryption/-/sodium-encryption-1.1.0.tgz","integrity":"sha512-THtS5QWBVo9zySjmUBE/zeLizlz0j0Jja0U3uc+UOXsw+GtE7vsSQw7Wu5Lu09LzDj020oIEUNkryoRGB2gLOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDy9hAZSKPHGqUx/gXqn8CTM7yv30V5wHvmLa7Z3QZXrgIgEY8kSfgFiUSRnD5YQZEEoG0RFHHiX/hsS7m36NrXU28="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sodium-encryption-1.1.0.tgz_1462288662206_0.4544892245903611"}},"1.2.0":{"name":"sodium-encryption","version":"1.2.0","description":"Sodium encryption that works in node and in the browser","main":"index.js","dependencies":{"tweetnacl":"^0.14.3","sodium-prebuilt":"^1.1.15"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"browser":"./browser.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sodium-encryption.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sodium-encryption/issues"},"homepage":"https://github.com/mafintosh/sodium-encryption","optionalDependencies":{"sodium-prebuilt":"^1.1.15"},"gitHead":"822742b80b958af2afc0604d235af4011baba365","_id":"sodium-encryption@1.2.0","_shasum":"d1d069344fc9fd293618aff80062fe82ed03eb04","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"d1d069344fc9fd293618aff80062fe82ed03eb04","tarball":"https://registry.npmjs.org/sodium-encryption/-/sodium-encryption-1.2.0.tgz","integrity":"sha512-W/GFB2dbFtd2xxC8VBybagUKj9XFXEEDOi45LpZ0A4NimnfrsLMi++e3aILqBiJk99Fh85RaJ7AXuEr1h8FoPA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRORlx/pD/AgcJzfo1pM1e8DV3we6l1xRUmD7aObvV2wIgHBtC36flrw9B30XXH4e+R4tw06NHPdDyv+hYMZBwGvg="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/sodium-encryption-1.2.0.tgz_1475961768678_0.11515221954323351"}},"1.2.1":{"name":"sodium-encryption","version":"1.2.1","description":"Sodium encryption that works in node and in the browser","main":"index.js","dependencies":{"tweetnacl":"^0.14.3","sodium-prebuilt":"^1.1.15"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"browser":"./browser.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sodium-encryption.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sodium-encryption/issues"},"homepage":"https://github.com/mafintosh/sodium-encryption","optionalDependencies":{"sodium-prebuilt":"^1.1.15"},"gitHead":"b0be8779846904e8224986ee22a1f93367b0a314","_id":"sodium-encryption@1.2.1","_shasum":"c8c659bf1ed8e07a47f72c7751c439eeaa86ce6a","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"c8c659bf1ed8e07a47f72c7751c439eeaa86ce6a","tarball":"https://registry.npmjs.org/sodium-encryption/-/sodium-encryption-1.2.1.tgz","integrity":"sha512-QYBraYWE1k/7FqI6vN0vhKmdMtShfmvq+l3UPvPVt/GrGlGBkBilM221rY2/AJEcpIEgSGrd6VxuGlJ4xHvBqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/w+xzgHilnZoJ3Cmpaj0IaSegO3Wbx9ORLm3+0aBx/QIgc4d+HJPxRwdYdjjledoU3hlxm2yq7eYksRY/Qq+PP5A="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/sodium-encryption-1.2.1.tgz_1475962208891_0.3773949097376317"}},"1.2.2":{"name":"sodium-encryption","version":"1.2.2","description":"Sodium encryption that works in node and in the browser","main":"index.js","dependencies":{"tweetnacl":"^0.14.3","sodium-prebuilt":"1.0.22"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"browser":"./browser.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sodium-encryption.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sodium-encryption/issues"},"homepage":"https://github.com/mafintosh/sodium-encryption","optionalDependencies":{"sodium-prebuilt":"1.0.22"},"gitHead":"f725d4539439081870dd5dbfe52b8625df039035","_id":"sodium-encryption@1.2.2","_shasum":"8f709a9f56584c077e303e3e2869d7fac65d599e","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"8f709a9f56584c077e303e3e2869d7fac65d599e","tarball":"https://registry.npmjs.org/sodium-encryption/-/sodium-encryption-1.2.2.tgz","integrity":"sha512-HpVva0PUXE/q8KI+gfDDP3yTvVPHGqdkw29Ho5F94xR6A3+95nNc2QQzNTn++T9GN3pApKzOPm4IUg6KMaH/Eg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICkQiXuQXSkAi8r1bDTY7osl0uIYlo8iPdNzyYvlovwlAiEAl5L7Q6gyEumKQ+/tcP5erZIojcOwM2CgTBuZt8UxZKs="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/sodium-encryption-1.2.2.tgz_1476043677991_0.996773973107338"}},"1.2.3":{"name":"sodium-encryption","version":"1.2.3","description":"Sodium encryption that works in node and in the browser","main":"index.js","dependencies":{"tweetnacl":"^0.14.3","sodium-native":"^1.5.1"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"browser":"./browser.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sodium-encryption.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sodium-encryption/issues"},"homepage":"https://github.com/mafintosh/sodium-encryption","optionalDependencies":{"sodium-native":"^1.5.1"},"gitHead":"42a7cba0f97718157e8c7a386ef94ba31e16837a","_id":"sodium-encryption@1.2.3","_shasum":"eb69ce283867960930d6526ea5800c7e04a8906e","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"eb69ce283867960930d6526ea5800c7e04a8906e","tarball":"https://registry.npmjs.org/sodium-encryption/-/sodium-encryption-1.2.3.tgz","integrity":"sha512-rmyNwc1zGcuIOwrcOD+Rcxa35lmhG+WDU+ATy8pMF43ZPrx7KjALOj9vR5EivWON/LMSLdRkjfcqQj5nRegjog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGFeqih9bPzrp+owrFdsiFs/L8KRRKn1xUQp5sn6urigIhAKaVFl9cTI2p6l/d/tLDyhWlS0cmTPbSSv7Yme5L1oe/"}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/sodium-encryption-1.2.3.tgz_1487329527742_0.25886591826565564"}}},"readme":"# sodium-encryption\n\n[Sodium encryption](https://github.com/paixaop/node-sodium) that works in node and in the browser\n\n```\nnpm install sodium-encryption\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/sodium-encryption.svg?style=flat)](http://travis-ci.org/mafintosh/sodium-encryption)\n\n## Usage\n\n``` js\nvar encryption = require('sodium-encryption')\n\nvar key = encryption.key()\nvar nonce = encryption.nonce()\nvar message = Buffer('a message')\n\nvar box = encryption.encrypt(message, nonce, key)\n\nconsole.log('encrypted message is:', box)\nconsole.log('decrypted message is:', encryption.decrypt(box, nonce, key))\n```\n\n## API\n\n#### `key = encryption.key()`\n\nGenerate a secret key. Returns a 32 byte buffer.\n\n#### `nonce = encryption.nonce()`\n\nGenerate a nonce. Returns a 24 byte buffer.\nA nonce can be public and you should use a new one everytime you use a key.\n\n#### `box = encryption.encrypt(message, nonce, key)`\n\nEncrypts a message.\n\n#### `message = encryption.decrypt(box, nonce, key)`\n\nDecrypt a message. Returns `null` is the message cannot be decrypted.\n\n#### `keys = encryption.scalarMultiplicationKeyPair([secretKey])`\n\nGenerate a key pair to be used for scalar multiplication. If you don't pass in a secret key, one will be generated for you.\nReturns a key pair consisting of a secret key and a public key.\n\n``` js\n{\n  secretKey: <Buffer>,\n  publicKey: <Buffer>\n}\n```\n\n#### `sharedKey = encryption.scalarMultiplication(secretKey, otherPublicKey)`\n\nGenerate a shared key based on a remote public scalar multiplication key and your own secret key.\nReturns the same shared key if called with corresponding secret and public key\n\n``` js\nvar keys = encryption.scalarMultiplicationKeyPair()\nvar otherKeys = encryption.scalarMultiplicationKeyPair()\n\nconsole.log('shared key', encryption.scalarMultiplication(keys.secretKey, otherKeys.publicKey))\nconsole.log('shared key', encryption.scalarMultiplication(otherKeys.secretKey, keys.publicKey))\n```\n\n## License\n\nMIT\n","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"time":{"modified":"2022-06-26T22:01:11.429Z","created":"2016-03-10T11:42:57.173Z","1.0.0":"2016-03-10T11:42:57.173Z","1.0.1":"2016-03-10T11:48:12.594Z","1.1.0":"2016-05-03T15:17:44.600Z","1.2.0":"2016-10-08T21:22:50.507Z","1.2.1":"2016-10-08T21:30:10.516Z","1.2.2":"2016-10-09T20:07:59.649Z","1.2.3":"2017-02-17T11:05:28.486Z"},"homepage":"https://github.com/mafintosh/sodium-encryption","repository":{"type":"git","url":"git+https://github.com/mafintosh/sodium-encryption.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"bugs":{"url":"https://github.com/mafintosh/sodium-encryption/issues"},"license":"MIT","readmeFilename":"README.md","users":{"akiva":true}}