{"_id":"@consento/libsodium-wrappers-sumo","_rev":"4-ec2fc4750351e17bc1a98d72f09ede8b","name":"@consento/libsodium-wrappers-sumo","dist-tags":{"latest":"0.7.7"},"versions":{"0.7.5":{"name":"@consento/libsodium-wrappers-sumo","version":"0.7.5","description":"The Sodium cryptographic library compiled to pure JavaScript (wrappers, sumo variant)","main":"dist/modules-sumo/libsodium-wrappers.js","repository":{"type":"git","url":"git+https://github.com/jedisct1/libsodium.js.git"},"dependencies":{"@consento/libsodium-sumo":"0.7.5"},"keywords":["crypto","sodium","libsodium","nacl","chacha20","poly1305","curve25519","ed25519","blake2","siphash","argon2","ecc"],"author":{"name":"Ahmad Ben Mrad","url":"@BatikhSouri"},"contributors":[{"name":"Frank Denis","url":"@jedisct1"},{"name":"Ryan Lester","url":"@buu700"}],"license":"ISC","bugs":{"url":"https://github.com/jedisct1/libsodium.js/issues"},"homepage":"https://github.com/jedisct1/libsodium.js","browser":{"fs":false},"gitHead":"dae2fd8dba017d54b2cb36805665f6475490aa5e","_id":"@consento/libsodium-wrappers-sumo@0.7.5","_nodeVersion":"12.9.1","_npmVersion":"6.10.2","dist":{"integrity":"sha512-pY+zKlGHQ+89lV35HSTQm9M8a901iBpZYjmHvIPTXdZ4fJjO7t4ouGqo28DUDPE1pg7ckCEqZgzKbOEki3dmpg==","shasum":"15ad22cd65381c458e55de78add89eefb32f21f9","tarball":"https://registry.npmjs.org/@consento/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.5.tgz","fileCount":4,"unpackedSize":78281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkcT1CRA9TVsSAnZWagAACp0QAIyfkk8e7ONLxvu26Zra\nATFnzlSvEPNL5Az8OwL4B8dG3Z6/+z13/kPVgY22HDfhKk5ULzSrKvZPi9Yz\nWNoHXqi9pgDKKiKJM3jXVcg0xjbVB7KReprSr8no2zk2nVL8YEXuiM4EMM7M\nbezTkfRpLZClqWAD3gmDPj4pY5z8uXeIDEsjVXst0CssbdLSqV17s50Ll/iV\npHiDp0+nRwwoUVPNnaFr2p03kRUjFSOxuGy/fndqZBlMfQJeAJd8pc42Kef1\niGIIavNSKdUgqb45B0yPIJbjbOjQDZQKLNplEGNXSoJ0G4Mw/0pUobyCiEC2\nq6rv1+an8AXd2kOExjCjWqNpgswkWNyLBHp/vGN5QYu6e3/8afVRwuZm9JL+\nGL4Li0Wda+tKqvpODz310sK2Y+OG8BKF2aFUHEfo+wQacUZMgbyZs6QodDjG\nUpJ1R9MLGBEZVEWh0NgdfPgNVNsLzm1a6UU1C2cgzAK0pR2mTdkTIWq7v0md\nJeKyoMDcWZ/F9Zub4SQltjg0GLsZ8k683+HUQjo2rwFYub6G2T/KZ67++zFM\n3YApSl5QOE/0K7+4FV9UZz4XGldmUh0SHNN4R5iLQRwCCeGwGSRoMOfMWYQ2\nRCNSatOa3KNTR6twCwQCwMI/Ir2pf8k2PQy0+GFZOemvSuVmNNbBFNg3Xh7F\nz5to\r\n=SGpX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDkzpBWAJqoUXWl3oLuZOlJb/vSeq5we6y0EAgTrao+lAiAr0cdujzgEcoiYIniG71KzfCNwAkewrYrUWMg44GAT8g=="}]},"maintainers":[{"name":"dkastl","email":"daniel@georepublic.de"},{"name":"leichtgewicht","email":"martin.heidegger@gmail.com"}],"_npmUser":{"name":"leichtgewicht","email":"martin.heidegger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/libsodium-wrappers-sumo_0.7.5_1569834228854_0.3538978872083711"},"_hasShrinkwrap":false},"0.7.6":{"name":"@consento/libsodium-wrappers-sumo","version":"0.7.6","description":"The Sodium cryptographic library compiled to pure JavaScript (wrappers, sumo variant)","main":"dist/modules-sumo/libsodium-wrappers.js","repository":{"type":"git","url":"git+https://github.com/jedisct1/libsodium.js.git"},"dependencies":{"@consento/libsodium-sumo":"0.7.6"},"keywords":["crypto","sodium","libsodium","nacl","chacha20","poly1305","curve25519","ed25519","blake2","siphash","argon2","ecc"],"author":{"name":"Ahmad Ben Mrad","url":"@BatikhSouri"},"contributors":[{"name":"Frank Denis","url":"@jedisct1"},{"name":"Ryan Lester","url":"@buu700"}],"license":"ISC","bugs":{"url":"https://github.com/jedisct1/libsodium.js/issues"},"homepage":"https://github.com/jedisct1/libsodium.js","browser":{"fs":false},"gitHead":"dae2fd8dba017d54b2cb36805665f6475490aa5e","_id":"@consento/libsodium-wrappers-sumo@0.7.6","_nodeVersion":"12.9.1","_npmVersion":"6.10.2","dist":{"integrity":"sha512-tc8NxgCZSLTIptcYJJpK12DOq6TH6jM65xZUBY8UeG8X/rTxhSmw52SeQ6OdaKFZtyMM8sYNotPtlAY2NokDjw==","shasum":"57c1cee26cf5b2d2626df3a07b59acb8d8ceb847","tarball":"https://registry.npmjs.org/@consento/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.6.tgz","fileCount":4,"unpackedSize":78301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkhuYCRA9TVsSAnZWagAAvqkP/jyjB4DfWGaIfFDiNslp\nS7kkJQeRspnF4tfYaRlGD9M632hX3dxCZInfuaFNdDPZRe5w2lKH5NEeWHVC\nR87s32rntiK87lquHDfTCJ7rvB5Soc5hG78lngGI45qFU7P45InVPlWAIzLa\ngZ2XYxdc5SlxWQma+TKuYrNX62EqrpXbCLteFUQw7tR8TqS1hIe0799UAMmA\njR3DaxQf8lg8zyCXnBfIq2pWTgCCKbmzYb5rZY9UqNqaA7x1JMUBzsXTuZBM\nRWBq3/XEzVcwlm7F2Yv787CQG9e+FWpxyrc0SIFCKV6xsbLTI4lchbsJmM7N\nA/sDheRPJGGoeMU66Vbvl09kHJZFmud3rR7PSt8p4jvWHRRQTWdrYgv85vko\nS2GWT6Y1xN6OjT+z9l29gkJD4thX7MrQgdxE7p4Bx7F6AmNZo2zDzrMJAAPI\nbvrT6SmuHmmU/jeTxnNyBu5LeXRf/5ZjzfmAcXdHW4skypsMea++MGTs9p9m\ndL4bl8YQfJVUpaPkOPBIVzhNxLKDb0SqKtU/7vF3fnxPBjjluh//X9zh98HG\ngjr8n5vg/mEjnLupYBAwzRCLVI1GonOl0Lw3DeqLD4a0ezU2Qom3DNzG+qPR\nItKEIQK6uefxEof206/okdKIrI6/mj7ijkByfz0CSt+7VMt5JJ3y3/iIfYi0\ntHhv\r\n=1gWo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUh8/dgANmVaMsQdb9V6DGofADxZVrflZeErE7gawmJwIhALxtON/doLVotyO4pgyWdxQ5vlKTeroWVL0YRwv+pS4l"}]},"maintainers":[{"name":"dkastl","email":"daniel@georepublic.de"},{"name":"leichtgewicht","email":"martin.heidegger@gmail.com"}],"_npmUser":{"name":"leichtgewicht","email":"martin.heidegger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/libsodium-wrappers-sumo_0.7.6_1569856407973_0.0869921799674811"},"_hasShrinkwrap":false},"0.7.7":{"name":"@consento/libsodium-wrappers-sumo","version":"0.7.7","description":"The Sodium cryptographic library compiled to pure JavaScript (wrappers, sumo variant)","main":"dist/modules-sumo/libsodium-wrappers.js","repository":{"type":"git","url":"git+https://github.com/jedisct1/libsodium.js.git"},"dependencies":{"@consento/libsodium-sumo":"0.7.7"},"keywords":["crypto","sodium","libsodium","nacl","chacha20","poly1305","curve25519","ed25519","blake2","siphash","argon2","ecc"],"author":{"name":"Ahmad Ben Mrad","url":"@BatikhSouri"},"contributors":[{"name":"Frank Denis","url":"@jedisct1"},{"name":"Ryan Lester","url":"@buu700"}],"license":"ISC","bugs":{"url":"https://github.com/jedisct1/libsodium.js/issues"},"homepage":"https://github.com/jedisct1/libsodium.js","browser":{"fs":false},"gitHead":"dae2fd8dba017d54b2cb36805665f6475490aa5e","_id":"@consento/libsodium-wrappers-sumo@0.7.7","_nodeVersion":"12.9.1","_npmVersion":"6.10.2","dist":{"integrity":"sha512-AfWTSeFd5ihbdVO8FdHpxanZJbTCSPWQObng5Z20jg2L1l4rKvm9OWx5AnLscQP5h2xoxU2E4EmoKakwsL+uyg==","shasum":"09f8f1be1da2f5ee65d41be127372520075747eb","tarball":"https://registry.npmjs.org/@consento/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.7.tgz","fileCount":4,"unpackedSize":78301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkkNoCRA9TVsSAnZWagAAbswP/RtgR+jqQnupOypoxZsB\nGwgniPLCCuaJWglmoBax/2JVR+HmCtYLwvK2Hf1lzGZw9WbD0bX7C7TSkklE\nkdqPP73wMJm168ivfKUUKXDBrmYAhWiEV/3RbxjpadR4VpGyliZlC0Jbw2OW\nR3jutPGY8Vb4JwPUIXLut8VDNBEnSHMHuxYSGA6ATQRUmv/n4kTXh4WfO9BB\nF0/R/ncW5hSz+XrFM/nLoc31CuK6+bBjKGFiDYXZ4RdTq/uFZTSF7hkpthGx\ns9o73DWa96o4onzdHDkB7+IMrF/rBVZ2cuUCSr5FqfdUdol13sCbAQ6v0DWb\nbho8gCRvOsHCNBWNieHM9K21oNfVy8nWW4D8rAiJCIM0UVw9bMfqfl8ii1fO\nEUs3KbMTl4OhVwbGo30HBftL7Kn4o66oCYYrv6DWGkDqRDfcNWfmwDAsq/zg\nwbfz0W/vFRDO6mRXdAzIDJ3cg26pxm3vO4qgP+rayPLj4Xn0dzVkP6OYll3A\nSaYk56f974R9GCk6qkXnrT+1u39SYQNfC/QI4gMSsQztQiI2lGJ7B4zbn3T8\nbrk5I7kwG++OXrvwGwo4rkGHXIOlS4Ixuq+GqcxDreEKDPpFbvPQikUgL9uY\nO5VYASdI0ymED4Deybc5+JxkmymUednerB8SqdDdaro9omfE0Q3NjWYIBmxK\nT+jV\r\n=NsUj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwLgYAKBJctjAbiWBIbQ9uHYNkJejFX0qx+EU1aPK00AIhAM3dd/PtHejqKLhSxsFj5l9udkg3XlfAO2kc/74aMr79"}]},"maintainers":[{"name":"dkastl","email":"daniel@georepublic.de"},{"name":"leichtgewicht","email":"martin.heidegger@gmail.com"}],"_npmUser":{"name":"leichtgewicht","email":"martin.heidegger@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/libsodium-wrappers-sumo_0.7.7_1569866600162_0.20865697078871048"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-30T09:03:48.657Z","0.7.5":"2019-09-30T09:03:49.002Z","modified":"2022-04-05T00:58:56.438Z","0.7.6":"2019-09-30T15:13:28.191Z","0.7.7":"2019-09-30T18:03:20.388Z"},"maintainers":[{"email":"rangermauve@hotmail.com","name":"rangermauve"},{"email":"daniel@georepublic.de","name":"dkastl"},{"email":"martin.heidegger@gmail.com","name":"leichtgewicht"}],"description":"The Sodium cryptographic library compiled to pure JavaScript (wrappers, sumo variant)","homepage":"https://github.com/jedisct1/libsodium.js","keywords":["crypto","sodium","libsodium","nacl","chacha20","poly1305","curve25519","ed25519","blake2","siphash","argon2","ecc"],"repository":{"type":"git","url":"git+https://github.com/jedisct1/libsodium.js.git"},"contributors":[{"name":"Frank Denis","url":"@jedisct1"},{"name":"Ryan Lester","url":"@buu700"}],"author":{"name":"Ahmad Ben Mrad","url":"@BatikhSouri"},"bugs":{"url":"https://github.com/jedisct1/libsodium.js/issues"},"license":"ISC","readme":"# libsodium.js\n\n## Overview\n\nThe [sodium](https://github.com/jedisct1/libsodium) crypto library\ncompiled to WebAssembly and pure JavaScript using\n[Emscripten](https://github.com/kripken/emscripten), with\nautomatically generated wrappers to make it easy to use in web\napplications.\n\nThe complete library weights 188 KB (minified, gzipped, includes pure JS +\nWebAssembly versions) and can run in a web browser as well as server-side.\n\n### Compatibility\n\nSupported browsers/JS engines:\n\n* Chrome >= 16\n* Edge >= 0.11\n* Firefox >= 21\n* Mobile Safari on iOS >= 8.0 (older versions produce incorrect results)\n* NodeJS\n* Opera >= 15\n* Safari >= 6 (older versions produce incorrect results)\n\n## Installation\n\nThe [dist](https://github.com/jedisct1/libsodium.js/tree/master/dist)\ndirectory contains pre-built scripts. Copy the files from one of its\nsubdirectories to your application:\n\n- [browsers](https://github.com/jedisct1/libsodium.js/tree/master/dist/browsers)\nincludes a single-file script that can be included in web pages.\nIt contains code for commonly used functions.\n- [browsers-sumo](https://github.com/jedisct1/libsodium.js/tree/master/dist/browsers-sumo)\nis a superset of the previous script, that contains all functions,\nincluding rarely used ones and undocumented ones.\n- [modules](https://github.com/jedisct1/libsodium.js/tree/master/dist/modules)\nincludes commonly used functions, and is designed to be loaded as a module.\n`libsodium-wrappers` is the module your application should load, which\nwill in turn automatically load `libsodium` as a dependency.\n- [modules-sumo](https://github.com/jedisct1/libsodium.js/tree/master/dist/modules-sumo)\ncontains sumo variants of the previous modules.\n\nThe modules are also available on npm:\n- [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers)\n- [libsodium-wrappers-sumo](https://www.npmjs.com/package/libsodium-wrappers-sumo)\n\nIf you prefer Bower:\n\n```sh\nbower install libsodium.js\n```\n\n### Usage (as a module)\n\nLoad the `sodium-wrappers` module. The returned object contains a `.ready`\nproperty: a promise that must be resolve before the sodium functions\ncan be used.\n\nExample:\n\n```js\nconst _sodium = require('libsodium-wrappers');\n(async() => {\n  await _sodium.ready;\n  const sodium = _sodium;\n\n  let key = sodium.crypto_secretstream_xchacha20poly1305_keygen();\n\n  let res = sodium.crypto_secretstream_xchacha20poly1305_init_push(key);\n  let [state_out, header] = [res.state, res.header];\n  let c1 = sodium.crypto_secretstream_xchacha20poly1305_push(state_out,\n    sodium.from_string('message 1'), null,\n    sodium.crypto_secretstream_xchacha20poly1305_TAG_MESSAGE);\n  let c2 = sodium.crypto_secretstream_xchacha20poly1305_push(state_out,\n    sodium.from_string('message 2'), null,\n    sodium.crypto_secretstream_xchacha20poly1305_TAG_FINAL);\n\n  let state_in = sodium.crypto_secretstream_xchacha20poly1305_init_pull(header, key);\n  let r1 = sodium.crypto_secretstream_xchacha20poly1305_pull(state_in, c1);\n  let [m1, tag1] = [sodium.to_string(r1.message), r1.tag];\n  let r2 = sodium.crypto_secretstream_xchacha20poly1305_pull(state_in, c2);\n  let [m2, tag2] = [sodium.to_string(r2.message), r2.tag];\n\n  console.log(m1);\n  console.log(m2);\n})();\n```\n\n### Usage (in a web browser, via a callback)\n\nThe `sodium.js` file includes both the core libsodium functions, as\nwell as the higher-level JavaScript wrappers. It can be loaded\nasynchronusly.\n\nA `sodium` object should be defined in the global namespace, with the\nfollowing property:\n\n- `onload`: the function to call after the wrapper is initialized.\n\nExample:\n\n```html\n<script>\n    window.sodium = {\n        onload: function (sodium) {\n            let h = sodium.crypto_generichash(64, sodium.from_string('test'));\n            console.log(sodium.to_hex(h));\n        }\n    };\n</script>\n<script src=\"sodium.js\" async></script>\n```\n\n## Additional helpers\n\n* `from_base64()`, `to_base64()` with an optional second parameter\nwhose value is one of: `base64_variants.ORIGINAL`, `base64_variants.ORIGINAL_NO_PADDING`,\n`base64_variants.URLSAFE` or `s.base64_variants.URLSAFE_NO_PADDING`. Default is `base64_variants.URLSAFE_NO_PADDING`.\n* `from_hex()`, `to_hex()`\n* `from_string()`, `to_string()`\n* `pad(<buffer>, <block size>)`, `unpad(<buffer>, <block size>)`\n* `memcmp()` (constant-time check for equality, returns `true` or `false`)\n* `compare()` (constant-time comparison. Values must have the same\nsize. Returns `-1`, `0` or `1`)\n* `memzero()` (applies to `Uint8Array` objects)\n* `increment()` (increments an arbitrary-long number stored as a\nlittle-endian `Uint8Array` - typically to increment nonces)\n* `add()` (adds two arbitrary-long numbers stored as little-endian\n`Uint8Array` vectors)\n* `is_zero()` (constant-time, checks `Uint8Array` objects for all zeros)\n\n## API\n\nThe API exposed by the wrappers is identical to the one of the C\nlibrary, except that buffer lengths never need to be explicitly given.\n\nBinary input buffers should be `Uint8Array` objects. However, if a string\nis given instead, the wrappers will automatically convert the string\nto an array containing a UTF-8 representation of the string.\n\nExample:\n\n```javascript\nvar key = sodium.randombytes_buf(sodium.crypto_shorthash_KEYBYTES),\n    hash1 = sodium.crypto_shorthash(new Uint8Array([1, 2, 3, 4]), key),\n    hash2 = sodium.crypto_shorthash('test', key);\n```\n\nIf the output is a unique binary buffer, it is returned as a\n`Uint8Array` object.\n\nExample (secretbox):\n\n```javascript\nlet key = sodium.from_hex('724b092810ec86d7e35c9d067702b31ef90bc43a7b598626749914d6a3e033ed');\n\nfunction encrypt_and_prepend_nonce(message) {\n    let nonce = sodium.randombytes_buf(sodium.crypto_secretbox_NONCEBYTES);\n    return nonce.concat(sodium.crypto_secretbox_easy(message, nonce, key));\n}\n\nfunction decrypt_after_extracting_nonce(nonce_and_ciphertext) {\n    if (nonce_and_ciphertext.length < sodium.crypto_secretbox_NONCEBYTES + sodium.crypto_secretbox_MACBYTES) {\n        throw \"Short message\";\n    }\n    let nonce = nonce_and_ciphertext.slice(0, sodium.crypto_secretbox_NONCEBYTES),\n        ciphertext = nonce_and_ciphertext.slice(sodium.crypto_secretbox_NONCEBYTES);\n    return sodium.crypto_secretbox_open_easy(ciphertext, nonce, key);\n}\n```\n\nIn addition, the `from_hex`, `to_hex`, `from_string`, and `to_string`\nfunctions are available to explicitly convert hexadecimal, and\narbitrary string representations from/to `Uint8Array` objects.\n\nFunctions returning more than one output buffer are returning them as\nan object. For example, the `sodium.crypto_box_keypair()` function\nreturns the following object:\n```javascript\n{ keyType: 'curve25519', privateKey: (Uint8Array), publicKey: (Uint8Array) }\n```\n\n### Standard vs Sumo version\n\nThe standard version (in the `dist/browsers` and `dist/modules`\ndirectories) contains the high-level functions, and is the recommended\none for most projects.\n\nAlternatively, the \"sumo\" version, available in the\n`dist/browsers-sumo` and `dist/modules-sumo` directories contains all\nthe symbols from the original library. This includes undocumented,\nuntested, deprecated, low-level and easy to misuse functions.\n\nThe `crypto_pwhash_*` function set is included in both versions.\n\nThe sumo version is slightly larger than the standard version, and\nshould be used only if you really need the extra symbols it provides.\n\n### Compilation\n\nIf you want to compile the files yourself, the following dependencies\nneed to be installed on your system:\n\n* Emscripten\n* binaryen\n* git\n* NodeJS\n* make\n\nRunning `make` will install the dev dependencies, clone libsodium,\nbuild it, test it, build the wrapper, and create the modules and\nminified distribution files.\n\n## Authors\n\nBuilt by Ahmad Ben Mrad, Frank Denis and Ryan Lester.\n\n## License\n\nThis wrapper is distributed under the\n[ISC License](https://en.wikipedia.org/wiki/ISC_license).\n","readmeFilename":"README.md"}