{"_id":"@hyperswarm/hypersign","_rev":"481447","name":"@hyperswarm/hypersign","description":"Utility methods related to public key cryptography to be used with distributed mutable storage","dist-tags":{"latest":"2.1.1"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"}],"time":{"modified":"2021-08-05T09:38:58.000Z","created":"2019-08-13T18:21:29.322Z","2.1.1":"2020-05-13T19:13:36.265Z","2.1.0":"2019-11-22T12:32:06.127Z","2.0.0":"2019-08-29T13:05:59.609Z","1.0.0":"2019-08-14T18:11:39.459Z","0.1.1":"2019-08-13T23:15:16.910Z","0.1.0":"2019-08-13T23:13:03.975Z","0.0.0":"2019-08-13T18:21:29.322Z"},"users":{},"author":{"name":"David Mark Clements","url":"@davidmarkclem"},"repository":{"type":"git","url":"git+https://github.com/hyperswarm/hypersign.git"},"versions":{"2.1.1":{"name":"@hyperswarm/hypersign","version":"2.1.1","description":"Utility methods related to public key cryptography to be used with distributed mutable storage","main":"index.js","dependencies":{"sodium-native":"^3.1.1"},"devDependencies":{"bencode":"^2.0.1","standard":"^13.1.0","tap":"^14.5.0"},"scripts":{"test":"tap --no-esm  -R classic test/*.test.js  && standard --fix","cov":"tap --no-esm -R classic --100 test/*.test.js","ci":"standard && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/hyperswarm/hypersign.git"},"author":{"name":"David Mark Clements","url":"@davidmarkclem"},"license":"MIT","bugs":{"url":"https://github.com/hyperswarm/hypersign/issues"},"homepage":"https://github.com/hyperswarm/hypersign","gitHead":"d1f5b20cb9ca88fd011d8cd3dc3bee1ccbe72046","_id":"@hyperswarm/hypersign@2.1.1","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"shasum":"4eb7035e86b23959686ce0cb5165e3bd27641618","size":3870,"noattachment":false,"key":"/@hyperswarm/hypersign/-/@hyperswarm/hypersign-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@hyperswarm/hypersign/download/@hyperswarm/hypersign-2.1.1.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"}],"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypersign_2.1.1_1589397216137_0.9923486122399217"},"_hasShrinkwrap":false,"publish_time":1589397216265,"_cnpm_publish_time":1589397216265},"2.1.0":{"name":"@hyperswarm/hypersign","version":"2.1.0","description":"Utility methods related to public key cryptography to be used with distributed mutable storage","main":"index.js","dependencies":{"sodium-universal":"^2.0.0"},"devDependencies":{"bencode":"^2.0.1","standard":"^13.1.0","tap":"^14.5.0"},"scripts":{"test":"tap --no-esm  -R classic test/*.test.js  && standard --fix","cov":"tap --no-esm -R classic --100 test/*.test.js","ci":"standard && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/hyperswarm/hypersign.git"},"author":{"name":"David Mark Clements","url":"@davidmarkclem"},"license":"MIT","bugs":{"url":"https://github.com/hyperswarm/hypersign/issues"},"homepage":"https://github.com/hyperswarm/hypersign","gitHead":"9505ebf39c395b4478937870c9b6256415c35b4c","_id":"@hyperswarm/hypersign@2.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"b242d2327cc82620497940a61d163fcefec477d4","size":3870,"noattachment":false,"key":"/@hyperswarm/hypersign/-/@hyperswarm/hypersign-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@hyperswarm/hypersign/download/@hyperswarm/hypersign-2.1.0.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypersign_2.1.0_1574425925968_0.2170741809967105"},"_hasShrinkwrap":false,"publish_time":1574425926127,"_cnpm_publish_time":1574425926127},"2.0.0":{"name":"@hyperswarm/hypersign","version":"2.0.0","description":"Utility methods related to public key cryptography to be used with distributed mutable storage","main":"index.js","dependencies":{"sodium-universal":"^2.0.0"},"devDependencies":{"bencode":"^2.0.1","standard":"^13.1.0","tap":"^14.5.0"},"scripts":{"test":"tap --no-esm  -R classic test/*.test.js  && standard --fix","cov":"tap --no-esm -R classic --100 test/*.test.js","ci":"standard && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/hyperswarm/hypersign.git"},"author":{"name":"David Mark Clements","url":"@davidmarkclem"},"license":"MIT","bugs":{"url":"https://github.com/hyperswarm/hypersign/issues"},"homepage":"https://github.com/hyperswarm/hypersign","gitHead":"300b0bffc30f95e60f5fe760db115097a978b63a","_id":"@hyperswarm/hypersign@2.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"86f1927eb19926d9db4ca4b0f3bbb3f99976ee54","size":3620,"noattachment":false,"key":"/@hyperswarm/hypersign/-/@hyperswarm/hypersign-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@hyperswarm/hypersign/download/@hyperswarm/hypersign-2.0.0.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypersign_2.0.0_1567083959499_0.7331514689920993"},"_hasShrinkwrap":false,"publish_time":1567083959609,"_cnpm_publish_time":1567083959609},"1.0.0":{"name":"@hyperswarm/hypersign","version":"1.0.0","description":"Utility methods related to public key cryptography to be used with distributed mutable storage","main":"index.js","dependencies":{"sodium-universal":"^2.0.0"},"devDependencies":{"standard":"^13.1.0","tap":"^14.5.0"},"scripts":{"test":"tap  -R classic test/*.test.js  && standard --fix","cov":"tap -R classic --100 test/*.test.js","ci":"standard && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/hyperswarm/hypersign.git"},"author":{"name":"David Mark Clements","url":"@davidmarkclem"},"license":"MIT","bugs":{"url":"https://github.com/hyperswarm/hypersign/issues"},"homepage":"https://github.com/hyperswarm/hypersign","gitHead":"6dc9adef34c17ed98aad0cfad2293f3499e4883b","_id":"@hyperswarm/hypersign@1.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"1bd2b941591d5cb3e4c3328217ee7dd8e68bddb7","size":3357,"noattachment":false,"key":"/@hyperswarm/hypersign/-/@hyperswarm/hypersign-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@hyperswarm/hypersign/download/@hyperswarm/hypersign-1.0.0.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypersign_1.0.0_1565806299302_0.0849722491840541"},"_hasShrinkwrap":false,"publish_time":1565806299459,"_cnpm_publish_time":1565806299459},"0.1.1":{"name":"@hyperswarm/hypersign","version":"0.1.1","description":"Utility methods related to public key cryptography to be used with distributed mutable storage","main":"index.js","dependencies":{"sodium-universal":"^2.0.0"},"devDependencies":{"standard":"^13.1.0","tap":"^14.5.0"},"scripts":{"test":"tap  -R classic test/*.test.js  && standard --fix","cov":"tap -R classic --100 test/*.test.js","ci":"standard && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/hyperswarm/hypersign.git"},"author":{"name":"David Mark Clements","url":"@davidmarkclem"},"license":"MIT","bugs":{"url":"https://github.com/hyperswarm/hypersign/issues"},"homepage":"https://github.com/hyperswarm/hypersign","gitHead":"ce1c3deeb2edf756ba9a5e29c9b5355c4d7142d1","_id":"@hyperswarm/hypersign@0.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"6d8d5f2b4a50d580788f625ccbb0d89f9dd79da3","size":3359,"noattachment":false,"key":"/@hyperswarm/hypersign/-/@hyperswarm/hypersign-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@hyperswarm/hypersign/download/@hyperswarm/hypersign-0.1.1.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypersign_0.1.1_1565738116784_0.5781786717783444"},"_hasShrinkwrap":false,"publish_time":1565738116910,"_cnpm_publish_time":1565738116910},"0.1.0":{"name":"@hyperswarm/hypersign","version":"0.1.0","description":"Utility methods related to public key cryptography to be used with distributed mutable storage","main":"index.js","dependencies":{"sodium-universal":"^2.0.0"},"devDependencies":{"standard":"^13.1.0","tap":"^14.5.0"},"scripts":{"test":"tap  -R classic test/*.test.js  && standard --fix","cov":"tap -R classic --100 test/*.test.js","ci":"standard && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/hyperswarm/hypersign.git"},"author":{"name":"David Mark Clements","url":"@davidmarkclem"},"license":"MIT","bugs":{"url":"https://github.com/hyperswarm/hypersign/issues"},"homepage":"https://github.com/hyperswarm/hypersign","gitHead":"0118aa7e97a38eebd9525563c110b168c45ed400","_id":"@hyperswarm/hypersign@0.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"7c435f999fb289516cc7c53277d9a26ddb5243e0","size":3362,"noattachment":false,"key":"/@hyperswarm/hypersign/-/@hyperswarm/hypersign-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@hyperswarm/hypersign/download/@hyperswarm/hypersign-0.1.0.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypersign_0.1.0_1565737983861_0.8220805768048576"},"_hasShrinkwrap":false,"publish_time":1565737983975,"_cnpm_publish_time":1565737983975},"0.0.0":{"name":"@hyperswarm/hypersign","version":"0.0.0","description":"Utility methods related to public key cryptography to be used with distributed mutable storage","main":"index.js","dependencies":{"sodium-universal":"^2.0.0"},"devDependencies":{"standard":"^13.1.0","tap":"^14.5.0"},"scripts":{"test":"tap  -R classic test/*.test.js  && standard --fix","cov":"tap -R classic --100 test/*.test.js","ci":"standard && npm run cov"},"repository":{"type":"git","url":"git+https://github.com/hyperswarm/hypersign.git"},"author":{"name":"David Mark Clements","url":"@davidmarkclem"},"license":"MIT","bugs":{"url":"https://github.com/hyperswarm/hypersign/issues"},"homepage":"https://github.com/hyperswarm/hypersign","gitHead":"f298f1c81b71d9bfe03ea8326d7b567f6d7291a1","_id":"@hyperswarm/hypersign@0.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"98c9e827ba7ac365d0a9965761e413e54872490c","size":3159,"noattachment":false,"key":"/@hyperswarm/hypersign/-/@hyperswarm/hypersign-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@hyperswarm/hypersign/download/@hyperswarm/hypersign-0.0.0.tgz"},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},{"name":"pfrazee","email":"pfrazee@gmail.com"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypersign_0.0.0_1565720489202_0.7697925147533795"},"_hasShrinkwrap":false,"publish_time":1565720489322,"_cnpm_publish_time":1565720489322}},"readme":"# @hyperswarm/hypersign\n\nUtility methods related to public key cryptography to be used with distributed mutable storage.\n\n```\nnpm install @hyperswarm/hypersign\n```\n\n## API\n\n#### `const { keypair, salt, sign, signable } = hypersign()`\n\nCall the exported function to get hypersign instance.\n\nThere is also a class `hypersign.HyperSign` which can be\nextended.\n\n#### `keypair()`\n\nUse this method to generate an assymetric keypair.\nReturns an object with `{publicKey, secretKey}`. `publicKey` holds a public key buffer, `secretKey` holds a private key buffer.\n\n#### `salt([str, ]size = 32)`\n\nUtility method for creating a random or hashed salt value.\n\nIf called with a string the string will be hashed, to a\ngeneric hash of `size` length.\n\nIf called without any inputs, or with a number, random \nbutes of `size` length will be\n\n#### `sign(value, options)`\n\nUtility method which can be used to create a `sig`.\n\nOptions:\n\n* `keypair` – REQUIRED, use `keypair` to generate this.\n* `salt` - OPTIONAL - default `undefined`, a buffer >= 16 and <= 64 bytes. If supplied it will salt the signature used to verify mutable values.\n* `seq` - OPTIONAL - default `0`. The sequence number of the value.\n\n#### `signable(value, options)`\n\nUtility method which returns the exact buffer that would be signed in by `sign`. This is only needed when using a salt, otherwise it will return the same `value` passed in. This method is to facilitate out-of-band signing (e.g. hardware signing), do not pass the returned signable value into `sign`, it already uses `signable`.\nIf you need to sign a value that has already been passed \nthrough `signable`, use `cryptoSign`.\n\nOptions:\n\n* `salt` - OPTIONAL - default `undefined`, a buffer >= 16 and <= 64 bytes. If supplied it will salt the signature used to verify mutable values.\n* `seq` - OPTIONAL - default `0`. The sequence number of the value.\n\n#### `cryptoSign(msg, keypair)`\n\nUtility method which can be used to create a signature using the `crypto_sign_detached` Sodium method. This only needs to be used \nwhen you *do not* need to apply encoding to `value`, `salt` and `seq`(e.g. if value and options have already been passed to `signable`).\n\nOptions:\n\n* `keypair` – REQUIRED, use `keypair` to generate this.\n* `salt` - OPTIONAL - default `undefined`, a buffer >= 16 and <= 64 bytes. If supplied it will salt the signature used to verify mutable values.\n* `seq` - OPTIONAL - default `0`. The sequence number of the value.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/hyperswarm/hypersign","bugs":{"url":"https://github.com/hyperswarm/hypersign/issues"},"license":"MIT"}