package.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. {
  2. "_args": [
  3. [
  4. {
  5. "raw": "tweetnacl@~0.14.0",
  6. "scope": null,
  7. "escapedName": "tweetnacl",
  8. "name": "tweetnacl",
  9. "rawSpec": "~0.14.0",
  10. "spec": ">=0.14.0 <0.15.0",
  11. "type": "range"
  12. },
  13. "/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/sshpk"
  14. ]
  15. ],
  16. "_from": "tweetnacl@>=0.14.0 <0.15.0",
  17. "_id": "tweetnacl@0.14.5",
  18. "_inCache": true,
  19. "_location": "/tweetnacl",
  20. "_nodeVersion": "7.0.0",
  21. "_npmOperationalInternal": {
  22. "host": "packages-12-west.internal.npmjs.com",
  23. "tmp": "tmp/tweetnacl-0.14.5.tgz_1481627515097_0.015130913350731134"
  24. },
  25. "_npmUser": {
  26. "name": "dchest",
  27. "email": "dmitry@codingrobots.com"
  28. },
  29. "_npmVersion": "3.10.8",
  30. "_phantomChildren": {},
  31. "_requested": {
  32. "raw": "tweetnacl@~0.14.0",
  33. "scope": null,
  34. "escapedName": "tweetnacl",
  35. "name": "tweetnacl",
  36. "rawSpec": "~0.14.0",
  37. "spec": ">=0.14.0 <0.15.0",
  38. "type": "range"
  39. },
  40. "_requiredBy": [
  41. "/bcrypt-pbkdf",
  42. "/sshpk"
  43. ],
  44. "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
  45. "_shasum": "5ae68177f192d4456269d108afa93ff8743f4f64",
  46. "_shrinkwrap": null,
  47. "_spec": "tweetnacl@~0.14.0",
  48. "_where": "/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/sshpk",
  49. "author": {
  50. "name": "TweetNaCl-js contributors"
  51. },
  52. "browser": {
  53. "buffer": false,
  54. "crypto": false
  55. },
  56. "bugs": {
  57. "url": "https://github.com/dchest/tweetnacl-js/issues"
  58. },
  59. "dependencies": {},
  60. "description": "Port of TweetNaCl cryptographic library to JavaScript",
  61. "devDependencies": {
  62. "browserify": "^13.0.0",
  63. "eslint": "^2.2.0",
  64. "faucet": "^0.0.1",
  65. "tap-browser-color": "^0.1.2",
  66. "tape": "^4.4.0",
  67. "tape-run": "^2.1.3",
  68. "tweetnacl-util": "^0.13.3",
  69. "uglify-js": "^2.6.1"
  70. },
  71. "directories": {
  72. "test": "test"
  73. },
  74. "dist": {
  75. "shasum": "5ae68177f192d4456269d108afa93ff8743f4f64",
  76. "tarball": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz"
  77. },
  78. "gitHead": "cce829e473b1ae299a9373b5140c713ee88f577f",
  79. "homepage": "https://tweetnacl.js.org",
  80. "keywords": [
  81. "crypto",
  82. "cryptography",
  83. "curve25519",
  84. "ed25519",
  85. "encrypt",
  86. "hash",
  87. "key",
  88. "nacl",
  89. "poly1305",
  90. "public",
  91. "salsa20",
  92. "signatures"
  93. ],
  94. "license": "Unlicense",
  95. "main": "nacl-fast.js",
  96. "maintainers": [
  97. {
  98. "name": "dchest",
  99. "email": "dmitry@codingrobots.com"
  100. }
  101. ],
  102. "name": "tweetnacl",
  103. "optionalDependencies": {},
  104. "readme": "TweetNaCl.js\n============\n\nPort of [TweetNaCl](http://tweetnacl.cr.yp.to) / [NaCl](http://nacl.cr.yp.to/)\nto JavaScript for modern browsers and Node.js. Public domain.\n\n[![Build Status](https://travis-ci.org/dchest/tweetnacl-js.svg?branch=master)\n](https://travis-ci.org/dchest/tweetnacl-js)\n\nDemo: <https://tweetnacl.js.org>\n\n**:warning: The library is stable and API is frozen, however it has not been\nindependently reviewed. If you can help reviewing it, please [contact\nme](mailto:dmitry@codingrobots.com).**\n\nDocumentation\n=============\n\n* [Overview](#overview)\n* [Installation](#installation)\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* [Benchmarks](#benchmarks)\n* [Contributors](#contributors)\n* [Who uses it](#who-uses-it)\n\n\nOverview\n--------\n\nThe primary goal of this project is to produce a translation of TweetNaCl to\nJavaScript which is as close as possible to the original C implementation, plus\na thin layer of idiomatic high-level API on top of it.\n\nThere are two versions, you can use either of them:\n\n* `nacl.js` is the port of TweetNaCl with minimum differences from the\n original + high-level API.\n\n* `nacl-fast.js` is like `nacl.js`, but with some functions replaced with\n faster versions.\n\n\nInstallation\n------------\n\nYou can install TweetNaCl.js via a package manager:\n\n[Bower](http://bower.io):\n\n $ bower install tweetnacl\n\n[NPM](https://www.npmjs.org/):\n\n $ npm install tweetnacl\n\nor [download source code](https://github.com/dchest/tweetnacl-js/releases).\n\n\nUsage\n-----\n\nAll API functions accept and return bytes as `Uint8Array`s. If you need to\nencode or decode strings, use functions from\n<https://github.com/dchest/tweetnacl-util-js> or one of the more robust codec\npackages.\n\nIn Node.js v4 and later `Buffer` objects are backed by `Uint8Array`s, so you\ncan freely pass them to TweetNaCl.js functions as arguments. The returned\nobjects are still `Uint8Array`s, so if you need `Buffer`s, you'll have to\nconvert them manually; make sure to convert using copying: `new Buffer(array)`,\ninstead of sharing: `new Buffer(array.buffer)`, because some functions return\nsubarrays of their buffers.\n\n\n### Public-key authenticated encryption (box)\n\nImplements *curve25519-xsalsa20-poly1305*.\n\n#### nacl.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 {\n publicKey: ..., // Uint8Array with 32-byte public key\n secretKey: ... // Uint8Array with 32-byte secret key\n }\n\n\n#### nacl.box.keyPair.fromSecretKey(secretKey)\n\nReturns a key pair for box with public key corresponding to the given secret\nkey.\n\n#### nacl.box(message, nonce, theirPublicKey, mySecretKey)\n\nEncrypt 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`nacl.box.overheadLength` longer than the original message.\n\n#### nacl.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 `false` if authentication fails.\n\n#### nacl.box.before(theirPublicKey, mySecretKey)\n\nReturns a precomputed shared key which can be used in `nacl.box.after` and\n`nacl.box.open.after`.\n\n#### nacl.box.after(message, nonce, sharedKey)\n\nSame as `nacl.box`, but uses a shared key precomputed with `nacl.box.before`.\n\n#### nacl.box.open.after(box, nonce, sharedKey)\n\nSame as `nacl.box.open`, but uses a shared key precomputed with `nacl.box.before`.\n\n#### nacl.box.publicKeyLength = 32\n\nLength of public key in bytes.\n\n#### nacl.box.secretKeyLength = 32\n\nLength of secret key in bytes.\n\n#### nacl.box.sharedKeyLength = 32\n\nLength of precomputed shared key in bytes.\n\n#### nacl.box.nonceLength = 24\n\nLength of nonce in bytes.\n\n#### nacl.box.overheadLength = 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#### nacl.secretbox(message, nonce, key)\n\nEncrypt 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`nacl.secretbox.overheadLength` longer than the original message.\n\n#### nacl.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 `false` if authentication fails.\n\n#### nacl.secretbox.keyLength = 32\n\nLength of key in bytes.\n\n#### nacl.secretbox.nonceLength = 24\n\nLength of nonce in bytes.\n\n#### nacl.secretbox.overheadLength = 16\n\nLength of overhead added to secret box compared to original message.\n\n\n### Scalar multiplication\n\nImplements *curve25519*.\n\n#### nacl.scalarMult(n, p)\n\nMultiplies an integer `n` by a group element `p` and returns the resulting\ngroup element.\n\n#### nacl.scalarMult.base(n)\n\nMultiplies an integer `n` by a standard group element and returns the resulting\ngroup element.\n\n#### nacl.scalarMult.scalarLength = 32\n\nLength of scalar in bytes.\n\n#### nacl.scalarMult.groupElementLength = 32\n\nLength of group element in bytes.\n\n\n### Signatures\n\nImplements [ed25519](http://ed25519.cr.yp.to).\n\n#### nacl.sign.keyPair()\n\nGenerates new random key pair for signing and returns it as an object with\n`publicKey` and `secretKey` members:\n\n {\n publicKey: ..., // Uint8Array with 32-byte public key\n secretKey: ... // Uint8Array with 64-byte secret key\n }\n\n#### nacl.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`nacl.sign.keyPair` or `nacl.sign.keyPair.fromSeed`.\n\n#### nacl.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 `nacl.sign.keyPair` to generate a new\nkey pair from a random seed.\n\n#### nacl.sign(message, secretKey)\n\nSigns the message using the secret key and returns a signed message.\n\n#### nacl.sign.open(signedMessage, publicKey)\n\nVerifies the signed message and returns the message without signature.\n\nReturns `null` if verification failed.\n\n#### nacl.sign.detached(message, secretKey)\n\nSigns the message using the secret key and returns a signature.\n\n#### nacl.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#### nacl.sign.publicKeyLength = 32\n\nLength of signing public key in bytes.\n\n#### nacl.sign.secretKeyLength = 64\n\nLength of signing secret key in bytes.\n\n#### nacl.sign.seedLength = 32\n\nLength of seed for `nacl.sign.keyPair.fromSeed` in bytes.\n\n#### nacl.sign.signatureLength = 64\n\nLength of signature in bytes.\n\n\n### Hashing\n\nImplements *SHA-512*.\n\n#### nacl.hash(message)\n\nReturns SHA-512 hash of the message.\n\n#### nacl.hash.hashLength = 64\n\nLength of hash in bytes.\n\n\n### Random bytes generation\n\n#### nacl.randomBytes(length)\n\nReturns a `Uint8Array` 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* `nacl.randomBytes`\n* `nacl.box.keyPair`\n* `nacl.sign.keyPair`\n\nOther functions are deterministic and will continue working.\n\nIf a platform you are targeting doesn't implement secure random number\ngenerator, but you somehow have a cryptographically-strong source of entropy\n(not `Math.random`!), and you know what you are doing, you can plug it into\nTweetNaCl.js like this:\n\n nacl.setPRNG(function(x, n) {\n // ... copy n random bytes into x ...\n });\n\nNote that `nacl.setPRNG` *completely replaces* internal random byte generator\nwith the one provided.\n\n\n### Constant-time comparison\n\n#### nacl.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 minified versions:\n\n $ npm run build\n\nTests use minified version, so make sure to rebuild it every time you change\n`nacl.js` or `nacl-fast.js`.\n\n### Testing\n\nTo run tests in Node.js:\n\n $ npm run test-node\n\nBy default all tests described here work on `nacl.min.js`. To test other\nversions, set environment variable `NACL_SRC` to the file name you want to test.\nFor example, the following command will test fast minified version:\n\n $ NACL_SRC=nacl-fast.min.js npm run test-node\n\nTo run full suite of tests in Node.js, including comparing outputs of\nJavaScript port to outputs of the original C version:\n\n $ npm run test-node-all\n\nTo prepare tests for browsers:\n\n $ npm run build-test-browser\n\nand then open `test/browser/test.html` (or `test/browser/test-fast.html`) to\nrun them.\n\nTo run headless browser tests with `tape-run` (powered by Electron):\n\n $ npm run test-browser\n\n(If you get `Error: spawn ENOENT`, install *xvfb*: `sudo apt-get install xvfb`.)\n\nTo run tests in both Node and Electron:\n\n $ npm test\n\n### Benchmarking\n\nTo run benchmarks in Node.js:\n\n $ npm run bench\n $ NACL_SRC=nacl-fast.min.js npm run bench\n\nTo run benchmarks in a browser, open `test/benchmark/bench.html` (or\n`test/benchmark/bench-fast.html`).\n\n\nBenchmarks\n----------\n\nFor reference, here are benchmarks from MacBook Pro (Retina, 13-inch, Mid 2014)\nlaptop with 2.6 GHz Intel Core i5 CPU (Intel) in Chrome 53/OS X and Xiaomi Redmi\nNote 3 smartphone with 1.8 GHz Qualcomm Snapdragon 650 64-bit CPU (ARM) in\nChrome 52/Android:\n\n| | nacl.js Intel | nacl-fast.js Intel | nacl.js ARM | nacl-fast.js ARM |\n| ------------- |:-------------:|:-------------------:|:-------------:|:-----------------:|\n| salsa20 | 1.3 MB/s | 128 MB/s | 0.4 MB/s | 43 MB/s |\n| poly1305 | 13 MB/s | 171 MB/s | 4 MB/s | 52 MB/s |\n| hash | 4 MB/s | 34 MB/s | 0.9 MB/s | 12 MB/s |\n| secretbox 1K | 1113 op/s | 57583 op/s | 334 op/s | 14227 op/s |\n| box 1K | 145 op/s | 718 op/s | 37 op/s | 368 op/s |\n| scalarMult | 171 op/s | 733 op/s | 56 op/s | 380 op/s |\n| sign | 77 op/s | 200 op/s | 20 op/s | 61 op/s |\n| sign.open | 39 op/s | 102 op/s | 11 op/s | 31 op/s |\n\n(You can run benchmarks on your devices by clicking on the links at the bottom\nof the [home page](https://tweetnacl.js.org)).\n\nIn short, with *nacl-fast.js* and 1024-byte messages you can expect to encrypt and\nauthenticate more than 57000 messages per second on a typical laptop or more than\n14000 messages per second on a $170 smartphone, sign about 200 and verify 100\nmessages per second on a laptop or 60 and 30 messages per second on a smartphone,\nper CPU core (with Web Workers you can do these operations in parallel),\nwhich is good enough for most applications.\n\n\nContributors\n------------\n\nSee AUTHORS.md file.\n\n\nThird-party libraries based on TweetNaCl.js\n-------------------------------------------\n\n* [forward-secrecy](https://github.com/alax/forward-secrecy) — Axolotl ratchet implementation\n* [nacl-stream](https://github.com/dchest/nacl-stream-js) - streaming encryption\n* [tweetnacl-auth-js](https://github.com/dchest/tweetnacl-auth-js) — implementation of [`crypto_auth`](http://nacl.cr.yp.to/auth.html)\n* [chloride](https://github.com/dominictarr/chloride) - unified API for various NaCl modules\n\n\nWho uses it\n-----------\n\nSome notable users of TweetNaCl.js:\n\n* [miniLock](http://minilock.io/)\n* [Stellar](https://www.stellar.org/)\n",
  105. "readmeFilename": "README.md",
  106. "repository": {
  107. "type": "git",
  108. "url": "git+https://github.com/dchest/tweetnacl-js.git"
  109. },
  110. "scripts": {
  111. "bench": "node test/benchmark/bench.js",
  112. "build": "uglifyjs nacl.js -c -m -o nacl.min.js && uglifyjs nacl-fast.js -c -m -o nacl-fast.min.js",
  113. "build-test-browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null && browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null",
  114. "lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js",
  115. "test": "npm run test-node-all && npm run test-browser",
  116. "test-browser": "NACL_SRC=${NACL_SRC:='nacl.min.js'} && npm run build-test-browser && cat $NACL_SRC test/browser/_bundle.js | tape-run | faucet",
  117. "test-node": "tape test/*.js | faucet",
  118. "test-node-all": "make -C test/c && tape test/*.js test/c/*.js | faucet"
  119. },
  120. "types": "nacl.d.ts",
  121. "version": "0.14.5"
  122. }