{"_id":"tweetnacl-ts","_rev":"6-bf6c9357374514a7c4bbfabf6a3151dc","name":"tweetnacl-ts","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"tweetnacl-ts","version":"1.0.0","description":"Port of TweetNaCl cryptographic library to TypeScript (and ES6)","main":"nacl.js","module":"es/nacl.js","typings":"nacl.d.ts","browser":{"./server/convert.js":"./client/convert.js","./es/server/convert.js":"./es/client/convert.js","./server/random.js":"./client/random.js","./es/server/random.js":"./es/client/random.js"},"scripts":{"compile":"npm run compile-es && npm run compile-js","clean":"npm run clean-es && npm run clean-js","compile-es":"tsc --outDir es --module es6","clean-es":"rm -rf es","compile-js":"tsc --outDir .","clean-js":"rm -rf nacl *.d.ts *.js *.js.map","prepublish":"npm run compile","compile-test":"browserify -d test/index.ts -p [ tsify --noImplicitAny ] -o test-out.js","clean-test":"rm -f test-out.js","test":"testem ci","test-node":"mocha -r ts-node/register test/index.ts -R spec","test-dev":"testem"},"repository":{"type":"git","url":"git+https://github.com/katyo/tweetnacl-ts.git"},"keywords":["crypto","cryptography","curve25519","ed25519","encrypt","hash","key","nacl","tweetnacl","poly1305","public","salsa20","signatures","sign","secret","box","secretbox","sealedbox","hmac","sha2","sha512","sha256","blake","blake2s","blake2b"],"author":{"name":"K.","email":"kayo@illumium.org"},"license":"UNLICENSED","bugs":{"url":"https://github.com/katyo/tweetnacl-ts/issues"},"homepage":"https://github.com/katyo/tweetnacl-ts#readme","devDependencies":{"@types/mocha":"^5.0.0","@types/node":"^9.4.6","browserify":"^16.1.1","mocha":"^5.0.3","testem":"^2.0.0","ts-node":"^5.0.1","tsify":"^3.0.3","typescript":"^2.8.1"},"dependencies":{"tslib":"^1.9.0"},"gitHead":"1c2d2d80b03d86e91ed0887c95f5548a32cf0d8c","_id":"tweetnacl-ts@1.0.0","_shasum":"349bfb67c90530cb398a6ffd92e0e3f5bb893c57","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.14.1","_npmUser":{"name":"kayo","email":"kayo@illumium.org"},"dist":{"shasum":"349bfb67c90530cb398a6ffd92e0e3f5bb893c57","tarball":"https://registry.npmjs.org/tweetnacl-ts/-/tweetnacl-ts-1.0.0.tgz","fileCount":169,"unpackedSize":582465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1tH1CRA9TVsSAnZWagAA29EP/jd1oayYhZ5wpMTiXdMG\ncHBEpf8FmAL2FsNPIRBTeZ/MBNQVQDNExEPQPaSUcNdcPxZBCIW/2xSKy1q5\nwRRw0AsQDg05MxWERiQQ1v/9DsBIBb0S8evCW11EMZnNZAI+xRUNvR4ydS2k\nR1Bg71YX88XpAMXmMNNcGHsn+Oe89VuXsVzS77M7uZcrrYoxwqSp+8PSIo1f\ncrk9P4yR1pQIidguNeaieSC1hZPHuVmziviG1Em7sS4rZlso3qv5MItldMw8\nkuFIQ6w+RZnZ97UaMDj/Di3vMeA5WmQ+y/AhrmaJWANq9HGIlWyBtLh7C86w\nBjrKW0u/PDi7zHwJmN+L4DnI9ScKAVe+wXW7DUs/nJ/Um9+l0qqxQQ7AyuJ9\nRZZysXkbXHR8zcvpTEc1uVyIgJcmO1LPGQT5iNyvA3GYMOfhsnEUIGPD9nrN\ndt+5QusK3ft4yaF5ycCZ11n042PopkybZVUxnHbJvGB/i+Fn+RzwORh0Zsqr\ncauJQ+ZbdiRFFSoAPiVWkFf5S3Na8gM3FqkHHQ1eQ++Ks3NxD5e4sRcSmTJ9\nc+wGR61bPPhk53FBq63yu9dgaR0aQbk4M+bPXvKTPGEP2CAdxVMlqu4hG45B\ni0VfGOL7jLjNirPtHLpTYz2OYODmYMYpHuhimfmCZffe/SDuu2bHbn5/+Ank\nCuvh\r\n=s3pI\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-RE12vxXjM5JD4tdhi7g8vaVzZw1dkyqVdy1/HG+WocM9GRkqn/6S31LD/m+MZ7ciU7vgpP2dmfuOsnJDdtsOnA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE7CZGmMVt8SA/ZGVQJCMXxuoVc+wy+V5EOawRMrZg4HAiEA2BLLoNbmTWxCfYwVdeC2/7Uo6nr/wkIKlOA7p49ThYw="}]},"maintainers":[{"name":"kayo","email":"kayo@illumium.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tweetnacl-ts_1.0.0_1524027892057_0.8454753932875037"},"_hasShrinkwrap":false},"1.0.1":{"name":"tweetnacl-ts","version":"1.0.1","description":"Port of TweetNaCl cryptographic library to TypeScript (and ES6)","main":"nacl.js","module":"es/nacl.js","typings":"nacl.d.ts","browser":{"./server/convert.js":"./client/convert.js","./es/server/convert.js":"./es/client/convert.js","./server/random.js":"./client/random.js","./es/server/random.js":"./es/client/random.js"},"scripts":{"compile":"npm run compile-es && npm run compile-js","clean":"npm run clean-es && npm run clean-js","compile-es":"tsc --outDir es --module es6","clean-es":"rm -rf es","compile-js":"tsc --outDir .","clean-js":"rm -rf nacl *.d.ts *.js *.js.map","prepublish":"npm run compile","compile-test":"browserify -d test/index.ts -p [ tsify --noImplicitAny ] -o test-out.js","clean-test":"rm -f test-out.js","test":"testem ci","test-node":"mocha -r ts-node/register test/index.ts -R spec","test-dev":"testem"},"repository":{"type":"git","url":"git+https://github.com/katyo/tweetnacl-ts.git"},"keywords":["crypto","cryptography","curve25519","ed25519","encrypt","hash","key","nacl","tweetnacl","poly1305","public","salsa20","signatures","sign","secret","box","secretbox","sealedbox","hmac","sha2","sha512","sha256","blake","blake2s","blake2b"],"author":{"name":"K.","email":"kayo@illumium.org"},"license":"UNLICENSED","bugs":{"url":"https://github.com/katyo/tweetnacl-ts/issues"},"homepage":"https://github.com/katyo/tweetnacl-ts#readme","devDependencies":{"@types/mocha":"^5.0.0","@types/node":"^9.4.6","browserify":"^16.1.1","mocha":"^5.0.3","testem":"^2.0.0","ts-node":"^5.0.1","tsify":"^3.0.3","typescript":"^2.8.1"},"dependencies":{"tslib":"^1.9.0"},"gitHead":"32e31beec56dc792b70be7db3382dbf5a68f4866","_id":"tweetnacl-ts@1.0.1","_shasum":"2e9436b5e7c6f3ea6371c1d5a9b191208b27b251","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.14.1","_npmUser":{"name":"kayo","email":"kayo@illumium.org"},"dist":{"shasum":"2e9436b5e7c6f3ea6371c1d5a9b191208b27b251","tarball":"https://registry.npmjs.org/tweetnacl-ts/-/tweetnacl-ts-1.0.1.tgz","fileCount":168,"unpackedSize":582398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa1t1cCRA9TVsSAnZWagAA0XYP/RLxuhUSxhT6c16TxyMD\nYg0kBXiYcu9n9VVDAGDKGRa+C/VbUzyVj8Xqkx+hltjpAAQ/NX1YeuomPNSh\nfskv7MW/FSxijgCssXJY35dRQJ2lETdluUP7wdYXBJlGvO2uETezb7TMhr8T\nRjDnJuLpCg7at4wGvdC9H2fudDDeDRMlftM6NP4zFrie6Nax8hmfY7l5u/oS\nS0AxlZCYysUB4ZifNcgvkXLhxrEo9eRRCd+f5Ke+XyriATGZW3epudWrN5yB\n8AJDnRQLj8iDe6/aJaL69ByMSeyXK+bOLtviMnu3yPSluLLn+un6NlNYOAks\ny5kEAsofsOS8Bz78zcRDdtobjjgiK58kU1oz7Hafhf8o8NGXUTCu3dzmT460\nK2hxgn9Ds3FPTg+4AFysP0rFJiqxBWhBkVcGE/BYF6AhRNaslU0bvbiueh+b\nsFvshh+EaAQ2G78nlrxmKCghUmXmnvXK18tAuobVuTd1pZyq0WJhayYV49TF\ntqrk3t7gpwRhyULLEyyrQujqKJDQDRjVz5REeCuqn8jAx9m9HprqAzjWqFOE\nFkmxJFkT87qcID2ukBO8Ig7CAZdVuEAxbD2a9V5cgN1238dKZn1FTQaFuHi2\nYFIZ86OCHOeYYv2HNpNico8saDolrq5ibFJ0D/1cpJKn5zscY96pmj1rfYPb\n5PMu\r\n=hOl5\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-DHkuD+IUXnNLb9X9AvQGJ2Leqzxe+jCNKWa9+y1xpSUOKzKHMQsHdGgrVKk5teDlU6wcmJNqX4gwhwYhxlHDeQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH39QxgZXPFEn5JREkicvvUETbtKB6S5KrKlPw3uIKj0AiEAjnYn94v8/CUs8aeDaipA41X0QS8Bxm/1i0qL4h+76I4="}]},"maintainers":[{"name":"kayo","email":"kayo@illumium.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tweetnacl-ts_1.0.1_1524030811582_0.11565112545232492"},"_hasShrinkwrap":false},"1.0.2":{"name":"tweetnacl-ts","version":"1.0.2","description":"Port of TweetNaCl cryptographic library to TypeScript (and ES6)","main":"nacl.js","module":"es/nacl.js","typings":"nacl.d.ts","browser":{"./server/convert.js":"./client/convert.js","./es/server/convert.js":"./es/client/convert.js","./server/random.js":"./client/random.js","./es/server/random.js":"./es/client/random.js"},"scripts":{"compile":"npm run compile-es && npm run compile-js","clean":"npm run clean-es && npm run clean-js","compile-es":"tsc --outDir es --module es6","clean-es":"rm -rf es","compile-js":"tsc --outDir .","clean-js":"rm -rf nacl *.d.ts *.js *.js.map","prepublish":"npm run compile","compile-test":"browserify -d test/index.ts -p [ tsify --noImplicitAny ] -o test-out.js","clean-test":"rm -f test-out.js","test":"testem ci","test-node":"mocha -r ts-node/register test/index.ts -R spec","test-dev":"testem"},"repository":{"type":"git","url":"git+https://github.com/katyo/tweetnacl-ts.git"},"keywords":["crypto","cryptography","curve25519","ed25519","encrypt","hash","key","nacl","tweetnacl","poly1305","public","salsa20","signatures","sign","secret","box","secretbox","sealedbox","hmac","sha2","sha512","sha256","blake","blake2s","blake2b"],"author":{"name":"K.","email":"kayo@illumium.org"},"license":"UNLICENSED","bugs":{"url":"https://github.com/katyo/tweetnacl-ts/issues"},"homepage":"https://github.com/katyo/tweetnacl-ts#readme","devDependencies":{"@types/mocha":"^5.0.0","@types/node":"^9.4.6","browserify":"^16.1.1","mocha":"^5.0.3","testem":"^2.0.0","ts-node":"^5.0.1","tsify":"^3.0.3","typescript":"^2.8.1"},"dependencies":{"tslib":"^1.9.0"},"gitHead":"89aed801f219a321d1cbafcd013d00b963923ca7","_id":"tweetnacl-ts@1.0.2","_shasum":"9843ad3a9107d1563fd50d56fc36ef9dbdd42a5f","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.14.1","_npmUser":{"name":"kayo","email":"kayo@illumium.org"},"dist":{"shasum":"9843ad3a9107d1563fd50d56fc36ef9dbdd42a5f","tarball":"https://registry.npmjs.org/tweetnacl-ts/-/tweetnacl-ts-1.0.2.tgz","fileCount":175,"unpackedSize":582991,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa5uYnCRA9TVsSAnZWagAAh9AP/jreSkrdJOENooqBwOTT\nLD+D+zTJAKI/61CC4QrgMtelc31Wj9E+UHevee6DOUrac5HSjPTUXGhxWaXQ\n/DWNYWCLyTqwQOy4H80/CsfH5cya0S7sjGALJZHb4BjyMksjHXT8p8m3Msr+\nO+/CoVt34+NQuw02SYFffbUKURS6OLJKbQ4bUcGtM9UxZLsZjWFQ52Rs/Q4E\nbvHs8+ERGFx3E2RzW4Cd84fbYkdJjtEsK/ErSuBR9pggmbFrfkL4e6Epd1uR\nYRHdBTrelhcrKko6Wo/SYV1fEt6hrJRNU0tJiZAHRMJahvcRCddei8PEXgTW\nWHjogY0oPgiY1ihmkXAK+xX3kAGbF6tsp0JLQhxvislxdh5/mcQsD/g1sYmY\nqpgWOlgdiySK2z/zalETHG3XLGUH3SEJ8EzOoCSjeg9VwqKDxgXWbVOBMZAy\nfs9zVgHvWo0JYXG7zhdvs/kdrIdPXtp3NCtiFiKFtLrMCG2iO+pFTIHhGlQL\nPbVeSSgh5qvQ5258RdSAIRb/IILAmeBavepj+bM7HwvcT1aVdrrUVTSXvgEu\ndKrz8QSdUwS46HvENcUm5MnpNp3Wo/dvcg+DVsmTiOFdzq4kW8Y3wbem7YBs\nUF/kYFAPxVi5s9qdfE2egKxHqxzjK9sAhZWZFa5kAUb6ydnwt9wSd+HyRytY\ntram\r\n=7xvX\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-5BLfLIV8+gRqWuuhipY0mcSQbYOcGcBFvSESUngu+AWl8JGLw+ACGBYXjW+vqYy4ydGM25N1Vf4DC/1r5ZEscQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBjXLtjSU88689+vqpy0690v9GaTbnbFytN6/5jwyHyHAiEA0tFwYqHYHmx0m/+ecqtXXp48nakvgXhKH7jdvs366Ac="}]},"maintainers":[{"name":"kayo","email":"kayo@illumium.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tweetnacl-ts_1.0.2_1525081637667_0.7288890482959793"},"_hasShrinkwrap":false},"1.0.3":{"name":"tweetnacl-ts","version":"1.0.3","description":"Port of TweetNaCl cryptographic library to TypeScript (and ES6)","main":"nacl.js","module":"es/nacl.js","typings":"nacl.d.ts","browser":{"./server/convert.js":"./client/convert.js","./es/server/convert.js":"./es/client/convert.js","./server/random.js":"./client/random.js","./es/server/random.js":"./es/client/random.js"},"scripts":{"compile":"npm run compile-es && npm run compile-js","clean":"npm run clean-es && npm run clean-js","compile-es":"tsc --outDir es --module es6","clean-es":"rm -rf es","compile-js":"tsc --outDir .","clean-js":"rm -rf nacl *.d.ts *.js *.js.map","prepublish":"npm run compile","compile-test":"browserify -d test/index.ts -p [ tsify --noImplicitAny ] -o test-out.js","clean-test":"rm -f test-out.js","test":"testem ci","test-node":"mocha -r ts-node/register test/index.ts -R spec","test-dev":"testem"},"repository":{"type":"git","url":"git+https://github.com/katyo/tweetnacl-ts.git"},"keywords":["crypto","cryptography","curve25519","ed25519","encrypt","hash","key","nacl","tweetnacl","poly1305","public","salsa20","signatures","sign","secret","box","secretbox","sealedbox","hmac","sha2","sha512","sha256","blake","blake2s","blake2b"],"author":{"name":"K.","email":"kayo@illumium.org"},"license":"UNLICENSED","bugs":{"url":"https://github.com/katyo/tweetnacl-ts/issues"},"homepage":"https://github.com/katyo/tweetnacl-ts#readme","devDependencies":{"@types/mocha":"^5","@types/node":"^8","browserify":"^16","mocha":"^5","testem":"^2","ts-node":"^7","tsify":"^4","typescript":"^3"},"dependencies":{"tslib":"^1"},"gitHead":"c37b9fc101efad25b008a6cec721e0600961485b","_id":"tweetnacl-ts@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"kayo","email":"kayo@illumium.org"},"dist":{"integrity":"sha512-C5I/dWf6xjAXaCDlf84T4HvozU/8ycAlq5WRllF1hAeeq5390tfXD+bNas5bhEV0HMSOx8bsQYpLjPl8wfnEeQ==","shasum":"ae4f31be6ca40e1b310f7fa47c0488ad71c0de7f","tarball":"https://registry.npmjs.org/tweetnacl-ts/-/tweetnacl-ts-1.0.3.tgz","fileCount":175,"unpackedSize":585007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcBiyzCRA9TVsSAnZWagAA68YP/0yCKkIyWrL78dzoI6eQ\nYj38xl6yHwlTdo62dKIwk8ljD89wYDBVNA7AJnv+hkg4uZASyNbwZifbuXK0\nhlZ3BcdYYiXs/ndWtRtuPd307GSP722t7gVKmF3cIghich2batpSmPwrcfXv\nk4bb6tVnxZo0weVHi8J+CzO1WIcYP5TbbUGRZJMWWlziTuRxX6Rx//X89lRA\nxB/NThtbcIbnLWeZXLJFQHriC+Gge5gBryVsn03Z5FrV+PnR2OLys8lthhsz\nc7wqFgAgv3Xn/xuHKB7qeZVdenszopMt0dW0pP+NO3ch29REErKIRRzaPLZw\nkLwTVI4KJmuluU+rL2QOeK5/vUNX7la8fxYDzVs9z+7hGa2hbCf0MZGjE5Qi\nwi4QogCYo+/8jG8KsVp1jMHRxb3fbZAM5bqQHCx2t9ZOgh/P5qTOvV5HPDuO\nC8OrdSMukFCsWPCEJEKaNI849QVAbWdacrWrSyQH+7eBgIwa1kdJJriS/mNG\ncKkHTNsw9ldYNu56Nv5rpW+jGsKlBxylaaEKsynjmrTWA+2BZJIhv9Qnr0Q0\nJK045kmQhDMV/ROtTK3xMIGJxp1cgCZxb+lwqdmSdLWKKYZN9owq3qZd2VEN\nc7/Hv9c1sduehSvNb0lsP2aLKcSu7RkSHAyequnqbjVZ3quqvG9GQO0Q2agz\nAHrs\r\n=nFcJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGtTX+UZq6Sl5Qvi7f+amDQms+uv5gqP1BiaEPoZ8uVWAiBj9hPixS9q3vwkqsRg56Sv1LcFtY33G1zFyO0XqcE0CA=="}]},"maintainers":[{"name":"kayo","email":"kayo@illumium.org"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tweetnacl-ts_1.0.3_1543908530957_0.09380318739794857"},"_hasShrinkwrap":false}},"time":{"created":"2018-04-18T05:04:52.057Z","1.0.0":"2018-04-18T05:04:52.115Z","modified":"2022-06-27T23:59:55.950Z","1.0.1":"2018-04-18T05:53:31.663Z","1.0.2":"2018-04-30T09:47:17.771Z","1.0.3":"2018-12-04T07:28:51.136Z"},"maintainers":[{"name":"kayo","email":"kayo@illumium.org"}],"description":"Port of TweetNaCl cryptographic library to TypeScript (and ES6)","homepage":"https://github.com/katyo/tweetnacl-ts#readme","keywords":["crypto","cryptography","curve25519","ed25519","encrypt","hash","key","nacl","tweetnacl","poly1305","public","salsa20","signatures","sign","secret","box","secretbox","sealedbox","hmac","sha2","sha512","sha256","blake","blake2s","blake2b"],"repository":{"type":"git","url":"git+https://github.com/katyo/tweetnacl-ts.git"},"author":{"name":"K.","email":"kayo@illumium.org"},"bugs":{"url":"https://github.com/katyo/tweetnacl-ts/issues"},"license":"UNLICENSED","readme":"# TweetNaCl in TypeScript (and ES6)\n\n[![npm version](https://badge.fury.io/js/tweetnacl-ts.svg)](https://badge.fury.io/js/tweetnacl-ts)\n[![npm downloads](https://img.shields.io/npm/dm/tweetnacl-ts.svg)](https://www.npmjs.com/package/tweetnacl-ts)\n[![Build Status](https://travis-ci.org/katyo/tweetnacl-ts.svg?branch=master)](https://travis-ci.org/katyo/tweetnacl-ts)\n\nPort of [TweetNaCl.js](https://tweetnacl.js.org) to **TypeScript** with several API changes for compatibility with Tree-Shaking to help modern JavaScript bundlers like Rollup and Webpack >2.x attain much optimization.\n\nAlso includes:\n\n* [TweetNaCl-Auth.js](https://github.com/dchest/tweetnacl-auth-js)\n* [TweetNaCl-Utils.js](https://github.com/dchest/tweetnacl-util-js)\n* [BlakeJS](https://github.com/dcposch/blakejs)\n* [TweetNaCl-SealedBox.js](https://github.com/whs/tweetnacl-sealed-box)\n\n__NOTE: May be you need `crypto.getRandomValues()` polyfill for browsers which doesn't supported it.__\n\nDocumentation\n=============\n\n* [Overview](#overview)\n* [Usage](#usage)\n  * [Public-key authenticated encryption (box)](#public-key-authenticated-encryption-box)\n  * [Secret-key authenticated encryption (secretbox)](#secret-key-authenticated-encryption-secretbox)\n  * [Scalar multiplication](#scalar-multiplication)\n  * [Signatures](#signatures)\n  * [Hashing](#hashing)\n  * [Random bytes generation](#random-bytes-generation)\n  * [Constant-time comparison](#constant-time-comparison)\n* [System requirements](#system-requirements)\n* [Development and testing](#development-and-testing)\n\n\nOverview\n--------\n\nOriginally this project had been a port of `nacl-fast.js` to TypeScript.\nNow it also includes support of SealedBox and HMAC-Auth.\n\nUsage\n-----\n\nAll API functions accept and return bytes as `ByteArray`s (natively as `Uint8Array`s).\nIf you need to encode or decode strings, use functions `encodeUTF8/decodeUTF8`.\n\n\n### Public-key authenticated encryption (box)\n\nImplements *x25519-xsalsa20-poly1305*.\n\n#### box\\_keyPair()\n\nGenerates a new random key pair for box and returns it as an object with\n`publicKey` and `secretKey` members:\n\n```typescript\ninterface BoxKeyPair {\n    publicKey: ByteArray; // Array with 32-byte public key\n    secretKey: ByteArray; // Array with 32-byte secret key\n}\n```\n\n#### box\\_keyPair\\_fromSecretKey(secretKey)\n\nReturns a key pair for box with public key corresponding to the given secret\nkey.\n\n#### box(message, nonce, theirPublicKey, mySecretKey)\n\nEncrypts and authenticates message using peer's public key, our secret key, and\nthe given nonce, which must be unique for each distinct message for a key pair.\n\nReturns an encrypted and authenticated message, which is\n`BoxLength.Overhead` longer than the original message.\n\n#### box\\_open(box, nonce, theirPublicKey, mySecretKey)\n\nAuthenticates and decrypts the given box with peer's public key, our secret\nkey, and the given nonce.\n\nReturns the original message, or `undefined` if authentication fails.\n\n#### box\\_before(theirPublicKey, mySecretKey)\n\nReturns a precomputed shared key which can be used in `box_after` and\n`box_open_after`.\n\n#### box\\_after(message, nonce, sharedKey)\n\nSame as `box`, but uses a shared key precomputed with `box_before`.\n\n#### box\\_open\\_after(box, nonce, sharedKey)\n\nSame as `box_open`, but uses a shared key precomputed with `box_before`.\n\n#### Constants\n\n##### BoxLength.PublicKey = 32\n\nLength of public key in bytes.\n\n##### BoxLength.SecretKey = 32\n\nLength of secret key in bytes.\n\n##### BoxLength.SharedKey = 32\n\nLength of precomputed shared key in bytes.\n\n##### BoxLength.Nonce = 24\n\nLength of nonce in bytes.\n\n##### BoxLength.Overhead = 16\n\nLength of overhead added to box compared to original message.\n\n\n### Secret-key authenticated encryption (secretbox)\n\nImplements *xsalsa20-poly1305*.\n\n#### secretbox(message, nonce, key)\n\nEncrypts and authenticates message using the key and the nonce. The nonce must\nbe unique for each distinct message for this key.\n\nReturns an encrypted and authenticated message, which is\n`SecretBox.Overhead` longer than the original message.\n\n#### secretbox\\_open(box, nonce, key)\n\nAuthenticates and decrypts the given secret box using the key and the nonce.\n\nReturns the original message, or `undefined` if authentication fails.\n\n#### Constants\n\n##### SecretBoxLength.Key = 32\n\nLength of key in bytes.\n\n##### SecretBoxLength.Nonce = 24\n\nLength of nonce in bytes.\n\n##### SecretBoxLength.Overhead = 16\n\nLength of overhead added to secret box compared to original message.\n\n\n### Sealed box encryption\n\nSealed boxes are designed to anonymously send messages\nto a recipient given its public key.\n\n#### sealedbox(message, publicKey)\n\nEncrypts message using the recipient's public key.\n\nReturns an encrypted message, which is `SealedBox.Overhead`\nlonger than the original message.\n\n#### sealedbox\\_open(box, publicKey, secretKey)\n\nDecrypts the given sealed box using the recipient's key pair.\n\nReturns the original message, or `undefined` if decryption fails.\n\n#### Constants\n\n##### SealedBoxLength.PublicKey = 32\n\nLength of public key of recipient in bytes.\n\n##### SealedBoxLength.SecretKey = 32\n\nLength of secret key of recipient in bytes.\n\n##### SealedBoxLength.Nonce = 24\n\nLength of nonce in bytes.\n\n##### SealedBoxLength.Overhead = 48\n\nLength of overhead added to box compared to original message.\n\n\n### Scalar multiplication\n\nImplements *x25519*.\n\n#### scalarMult(n, p)\n\nMultiplies an integer `n` by a group element `p` and returns the resulting\ngroup element.\n\n#### scalarMult\\_base(n)\n\nMultiplies an integer `n` by a standard group element and returns the resulting\ngroup element.\n\n#### Constants\n\n##### ScalarMultLength.Scalar = 32\n\nLength of scalar in bytes.\n\n##### ScalarMultLength.GroupElement = 32\n\nLength of group element in bytes.\n\n\n### Signatures\n\nImplements [ed25519](http://ed25519.cr.yp.to).\n\n#### sign\\_keyPair()\n\nGenerates new random key pair for signing and returns it as an object with\n`publicKey` and `secretKey` members:\n\n```typescript\ninterface SignKeyPair {\n    publicKey: ByteArray; // Array with 32-byte public key\n    secretKey: ByteArray; // Array with 64-byte secret key\n}\n```\n\n#### sign\\_keyPair\\_fromSecretKey(secretKey)\n\nReturns a signing key pair with public key corresponding to the given\n64-byte secret key. The secret key must have been generated by\n`sign_keyPair` or `sign_keyPair_fromSeed`.\n\n#### sign\\_keyPair\\_fromSeed(seed)\n\nReturns a new signing key pair generated deterministically from a 32-byte seed.\nThe seed must contain enough entropy to be secure. This method is not\nrecommended for general use: instead, use `sign_keyPair` to generate a new\nkey pair from a random seed.\n\n#### sign(message, secretKey)\n\nSigns the message using the secret key and returns a signed message.\n\n#### sign\\_open(signedMessage, publicKey)\n\nVerifies the signed message and returns the message without signature.\n\nReturns `undefined` if verification failed.\n\n#### sign\\_detached(message, secretKey)\n\nSigns the message using the secret key and returns a signature.\n\n#### sign\\_detached\\_verify(message, signature, publicKey)\n\nVerifies the signature for the message and returns `true` if verification\nsucceeded or `false` if it failed.\n\n#### Constants\n\n##### SignLength.PublicKey = 32\n\nLength of signing public key in bytes.\n\n##### SignLength.SecretKey = 64\n\nLength of signing secret key in bytes.\n\n##### SignLength.Seed = 32\n\nLength of seed for `sign_keyPair_fromSeed` in bytes.\n\n##### SignLength.Signature = 64\n\nLength of signature in bytes.\n\n\n### Hashing\n\nImplements *SHA-512*.\n\n#### hash(message)\n\nReturns SHA-512 hash of the message.\n\n#### Constants\n\n##### HashLength.Hash = 64\n\nLength of hash in bytes.\n\n### Authenticating\n\nImplements *HMAC-SHA-512-256*\n\n#### auth(message, key)\n\nAuthenticates the given message with the secret key.\n(In other words, returns HMAC-SHA-512-256 of the message under the key.)\n\n#### auth\\_full(message, key)\n\nReturns HMAC-SHA-512 (without truncation) of the message under the key\n\n#### AuthLength.Auth = 32\n\nLength of authenticator returned by `auth`.\n\n#### AuthLength.AuthFull = 64\n\nLength of authenticator returned by `auth_full`.\n\n#### AuthLength.Key = 32\n\nLength of key for `auth` and `auth_full` (key length is currently not\nenforced).\n\n\n### Random bytes generation\n\n#### randomBytes(length)\n\nReturns a `ByteArray` of the given length containing random bytes of\ncryptographic quality.\n\n**Implementation note**\n\nTweetNaCl.js uses the following methods to generate random bytes,\ndepending on the platform it runs on:\n\n* `window.crypto.getRandomValues` (WebCrypto standard)\n* `window.msCrypto.getRandomValues` (Internet Explorer 11)\n* `crypto.randomBytes` (Node.js)\n\nIf the platform doesn't provide a suitable PRNG, the following functions,\nwhich require random numbers, will throw exception:\n\n* `randomBytes`\n* `box_keyPair`\n* `sign_keyPair`\n\nOther functions are deterministic and will continue working.\n\n### Constant-time comparison\n\n#### verify(x, y)\n\nCompares `x` and `y` in constant time and returns `true` if their lengths are\nnon-zero and equal, and their contents are equal.\n\nReturns `false` if either of the arguments has zero length, or arguments have\ndifferent lengths, or their contents differ.\n\n\nSystem requirements\n-------------------\n\nTweetNaCl.js supports modern browsers that have a cryptographically secure\npseudorandom number generator and typed arrays, including the latest versions\nof:\n\n* Chrome\n* Firefox\n* Safari (Mac, iOS)\n* Internet Explorer 11\n\nOther systems:\n\n* Node.js\n\n\nDevelopment and testing\n------------------------\n\nInstall NPM modules needed for development:\n\n    $ npm install\n\nTo build js run compilation:\n\n    $ npm run compile\n\n### Testing\n\nTo run tests in Node:\n\n    $ npm run test-node\n\nTo run tests in browsers and Node (CI-mode):\n\n    $ npm run test\n\nTo run tests in browsers and Node (Dev-mode):\n\n    $ npm run test-dev\n","readmeFilename":"README.md"}