{"_id":"ed2curve","_rev":"13-9e390f3532571087c6dcf3a2f528d754","name":"ed2curve","description":"Convert Ed25519 signing keys into Curve25519 Diffie-Hellman keys.","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.1":{"name":"ed2curve","version":"0.1.1","description":"Convert Ed25519 signing keys into Curve25519 Diffie-Hellman keys.","main":"ed2curve.js","directories":{"test":"test"},"scripts":{"build":"uglifyjs ed2curve.js -c -m -o ed2curve.min.js","test":"faucet test/*.js"},"repository":{"type":"git","url":"https://github.com/dchest/ed2curve-js"},"keywords":["ed25519","curve25519","djb","crypto","public","keys","edwards","montgomery","elliptic"],"author":{"name":"Dmitry Chestnykh"},"license":"Public domain","bugs":{"url":"https://github.com/dchest/ed2curve-js/issues"},"homepage":"https://github.com/dchest/ed2curve-js","dependencies":{"tweetnacl":"^0.11.0"},"devDependencies":{"faucet":"0.0.1","tape":"^2.13.4"},"gitHead":"e7dc9209cd0d1bd79906fde63a1d243f01b809a3","_id":"ed2curve@0.1.1","_shasum":"51994d3ff5cbd99fb6265d5c38877c0ba9a191d3","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"dchest","email":"dmitry@codingrobots.com"},"maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"dist":{"shasum":"51994d3ff5cbd99fb6265d5c38877c0ba9a191d3","tarball":"https://registry.npmjs.org/ed2curve/-/ed2curve-0.1.1.tgz","integrity":"sha512-lFZRuiQyu9yjHghTtPcTEbcJ8PKpRrDUF4ENuoxGmAl7ukBYvMWLy3286eylJhpOUl8I3u52eZVkqqS463XtZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCim7SWG2KNiN+Mhn8MlZxN2NAH1QiIu3xNBIz1E+QsMAIgNlA8CjbRdB5KL+uE1q+J0g6tiuQpmyNf7OAmM7UreUQ="}]}},"0.1.2":{"name":"ed2curve","version":"0.1.2","description":"Convert Ed25519 signing keys into Curve25519 Diffie-Hellman keys.","main":"ed2curve.js","directories":{"test":"test"},"scripts":{"build":"uglifyjs ed2curve.js -c -m -o ed2curve.min.js","test":"faucet test/*.js"},"repository":{"type":"git","url":"https://github.com/dchest/ed2curve-js"},"keywords":["ed25519","curve25519","djb","crypto","public","keys","edwards","montgomery","elliptic"],"author":{"name":"Dmitry Chestnykh"},"license":"Public domain","bugs":{"url":"https://github.com/dchest/ed2curve-js/issues"},"homepage":"https://github.com/dchest/ed2curve-js","dependencies":{"tweetnacl":"0.11.x"},"devDependencies":{"faucet":"0.x.x","tape":"2.x.x","uglify-js":"2.x.x"},"gitHead":"a50cb390d3c122a29bfce091981597d3405d556b","_id":"ed2curve@0.1.2","_shasum":"76e68f9139d4c20cd42f4183cd40d0d0b70a4529","_from":".","_npmVersion":"2.0.0-beta.0","_npmUser":{"name":"dchest","email":"dmitry@codingrobots.com"},"maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"dist":{"shasum":"76e68f9139d4c20cd42f4183cd40d0d0b70a4529","tarball":"https://registry.npmjs.org/ed2curve/-/ed2curve-0.1.2.tgz","integrity":"sha512-kgi2cK5ZkAPP2gTPldcGV0A3U3D6nu7vcldkNg/vZxQsIsAPxPw3S2wle345/9Z4jP2TvHdb2/Ky0AtqPwuS7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoCnZN1VP8ONlUBCiMvI/PmrpinDM0ow123G+uOxzLjgIhAKU2kgW47X1wyS5cExWhlKLGjPunzbpnGeZ+M72QERRp"}]}},"0.1.3":{"name":"ed2curve","version":"0.1.3","description":"Convert Ed25519 signing keys into Curve25519 Diffie-Hellman keys.","main":"ed2curve.js","directories":{"test":"test"},"scripts":{"build":"uglifyjs ed2curve.js -c -m -o ed2curve.min.js","test":"faucet test/*.js"},"repository":{"type":"git","url":"https://github.com/dchest/ed2curve-js"},"keywords":["ed25519","curve25519","djb","crypto","public","keys","edwards","montgomery","elliptic"],"author":{"name":"Dmitry Chestnykh"},"license":"Public domain","bugs":{"url":"https://github.com/dchest/ed2curve-js/issues"},"homepage":"https://github.com/dchest/ed2curve-js","dependencies":{"tweetnacl":"0.x.x"},"devDependencies":{"faucet":"0.x.x","tape":"2.x.x","uglify-js":"2.x.x"},"gitHead":"d69227b3c6ea231ce0edd467f3f8d7d9f804db9d","_id":"ed2curve@0.1.3","_shasum":"0f5efd50a526a1222f3cbb3e900c39a20f9bedb5","_from":".","_npmVersion":"2.0.0-beta.0","_npmUser":{"name":"dchest","email":"dmitry@codingrobots.com"},"maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"dist":{"shasum":"0f5efd50a526a1222f3cbb3e900c39a20f9bedb5","tarball":"https://registry.npmjs.org/ed2curve/-/ed2curve-0.1.3.tgz","integrity":"sha512-+1+2UTS3jcqbhhvbWWE9S2tdi5fP/elAoLvmaLDSbuF0kNMmu16WJgDfTHlLynK6ygQy/qH04tAPrracpQxQEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGqidiHFjtME2cIMVm7an77XgH3sZRnV2B/q7QbHwqxwIga84JdU1pBwHwAN7W5LQuoicdy28FLjPe7oKz2JOw4Uo="}]}},"0.1.4":{"name":"ed2curve","version":"0.1.4","description":"Convert Ed25519 signing keys into Curve25519 Diffie-Hellman keys.","main":"ed2curve.js","directories":{"test":"test"},"scripts":{"build":"uglifyjs ed2curve.js -c -m -o ed2curve.min.js","test":"faucet test/*.js"},"repository":{"type":"git","url":"git+https://github.com/dchest/ed2curve-js.git"},"keywords":["ed25519","curve25519","djb","crypto","public","keys","edwards","montgomery","elliptic"],"author":{"name":"Dmitry Chestnykh"},"license":"Public domain","bugs":{"url":"https://github.com/dchest/ed2curve-js/issues"},"homepage":"https://github.com/dchest/ed2curve-js","dependencies":{"tweetnacl":"0.x.x"},"devDependencies":{"faucet":"0.x.x","tape":"2.x.x","tweetnacl-util":"^0.13.3","uglify-js":"^2.6.1"},"gitHead":"d6501f30ef931f1289e9b24f542bb75e65c1c605","_id":"ed2curve@0.1.4","_shasum":"94a44248bb87da35db0eff7af0aa576168117f59","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"dchest","email":"dmitry@codingrobots.com"},"dist":{"shasum":"94a44248bb87da35db0eff7af0aa576168117f59","tarball":"https://registry.npmjs.org/ed2curve/-/ed2curve-0.1.4.tgz","integrity":"sha512-hDZWhCHZ1wu4P2g2RVsM2MjDmmJzhvcsXr5qHUSBJZXvuhJSunhbVsWoBXdIe0/yTa3RV4UaWpOmFmrVsKr0wA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNb0iBP/j2nlJsd3LzHi9hSdinV/bw/2wDCXTk/tPL9gIhAO2jw43f9FiYmFhHIjCzzssbM0CABINthtdpxf2N9yRj"}]},"maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/ed2curve-0.1.4.tgz_1455985127580_0.5973855033516884"}},"0.2.0":{"name":"ed2curve","version":"0.2.0","description":"Convert Ed25519 signing keys into Curve25519 Diffie-Hellman keys.","main":"ed2curve.js","directories":{"test":"test"},"scripts":{"build":"uglifyjs ed2curve.js -c -m -o ed2curve.min.js","test":"faucet test/*.js"},"repository":{"type":"git","url":"git+https://github.com/dchest/ed2curve-js.git"},"keywords":["ed25519","curve25519","djb","crypto","public","keys","edwards","montgomery","elliptic"],"author":{"name":"Dmitry Chestnykh"},"license":"Public domain","bugs":{"url":"https://github.com/dchest/ed2curve-js/issues"},"homepage":"https://github.com/dchest/ed2curve-js","dependencies":{"tweetnacl":"0.x.x"},"devDependencies":{"faucet":"0.x.x","tape":"2.x.x","tweetnacl-util":"^0.13.3","uglify-js":"^2.6.1"},"gitHead":"6562bf84baca75b027cccec1df915c84a33a1a9c","_id":"ed2curve@0.2.0","_shasum":"962788efd2d09501a911f57d17a38025e0097331","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.1","_npmUser":{"name":"dchest","email":"dmitry@codingrobots.com"},"dist":{"shasum":"962788efd2d09501a911f57d17a38025e0097331","tarball":"https://registry.npmjs.org/ed2curve/-/ed2curve-0.2.0.tgz","integrity":"sha512-V46HlvrkdCvoAzZjfo6IBC80LMUYIJNSBi/YGKCgAPL/qAJfQgp9WKMzRDPt1HFRSJlZYnoeaPLPOeMuMqH1Xw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJxhV1rySt3/uT5jhLwQKxaaqya1UdcdIG+WmdPEf6cAiAI7vopHe/X12YBDbwGM+WbMQlUUbJHyBsEWwIyR+uTIg=="}]},"maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ed2curve-0.2.0.tgz_1482318469328_0.3675192822702229"}},"0.2.1":{"name":"ed2curve","version":"0.2.1","description":"Convert Ed25519 signing keys into Curve25519 Diffie-Hellman keys.","main":"ed2curve.js","directories":{"test":"test"},"scripts":{"build":"uglifyjs ed2curve.js -c -m -o ed2curve.min.js","test":"faucet test/*.js"},"repository":{"type":"git","url":"git+https://github.com/dchest/ed2curve-js.git"},"keywords":["ed25519","curve25519","djb","crypto","public","keys","edwards","montgomery","elliptic"],"author":{"name":"Dmitry Chestnykh"},"license":"Unlicense","bugs":{"url":"https://github.com/dchest/ed2curve-js/issues"},"homepage":"https://github.com/dchest/ed2curve-js","dependencies":{"tweetnacl":"0.x.x"},"devDependencies":{"faucet":"0.x.x","tape":"2.x.x","tweetnacl-util":"^0.13.3","uglify-js":"^2.6.1"},"gitHead":"7243a93cffaa6430f46749fd76b65f1c83fd222a","_id":"ed2curve@0.2.1","_shasum":"22e6aaa3569e3c4dbf4eefa29612ec329e58190c","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.1","_npmUser":{"name":"dchest","email":"dmitry@codingrobots.com"},"dist":{"shasum":"22e6aaa3569e3c4dbf4eefa29612ec329e58190c","tarball":"https://registry.npmjs.org/ed2curve/-/ed2curve-0.2.1.tgz","integrity":"sha512-lChFRsYZqp2tZvPnej3w6tH/oW2vCQ/C8pdsLvQHekhOkq3zHiayEfCxz/Opabsa+ZIPGujD7BlDuzmD+1EnmA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaJPeoM+1y46zYm8hQDySbZewpqEz1CtEYc4W/M9g8RAIgW1IrplOCYtfbTNEkoecPUTf4cV7Bqy52bgVYlcX4+mo="}]},"maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ed2curve-0.2.1.tgz_1482318970212_0.0651856332551688"}},"0.3.0":{"name":"ed2curve","version":"0.3.0","description":"Convert Ed25519 signing keys into Curve25519 Diffie-Hellman keys.","main":"ed2curve.js","directories":{"test":"test"},"scripts":{"build":"uglifyjs ed2curve.js -c -m -o ed2curve.min.js","test":"faucet test/*.js"},"repository":{"type":"git","url":"git+https://github.com/dchest/ed2curve-js.git"},"keywords":["ed25519","curve25519","djb","crypto","public","keys","edwards","montgomery","elliptic"],"author":{"name":"Dmitry Chestnykh"},"license":"Unlicense","bugs":{"url":"https://github.com/dchest/ed2curve-js/issues"},"homepage":"https://github.com/dchest/ed2curve-js","dependencies":{"tweetnacl":"1.x.x"},"devDependencies":{"faucet":"0.x.x","tape":"4.13.0","tweetnacl-util":"^0.15.0","uglify-js":"^3.7.5"},"gitHead":"35e0509555f9e9a8d209ad758ee88ffc3004c423","_id":"ed2curve@0.3.0","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","_npmUser":{"name":"dchest","email":"dmitry@codingrobots.com"},"dist":{"integrity":"sha512-8w2fmmq3hv9rCrcI7g9hms2pMunQr1JINfcjwR9tAyZqhtyaMN991lF/ZfHfr5tzZQ8c7y7aBgZbjfbd0fjFwQ==","shasum":"322b575152a45305429d546b071823a93129a05d","tarball":"https://registry.npmjs.org/ed2curve/-/ed2curve-0.3.0.tgz","fileCount":5,"unpackedSize":15468,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeILa1CRA9TVsSAnZWagAAbVcQAIZERLKsx0th44sJ/9sC\nB8gM4iwwfBsp5Mu0PdyT0a7dk4mNvTZx/txL9fXR/BprGjTUqlav6A39aWu3\nMLH4CMIKjahgirEPsb6T3TiRY7AcghOTq8M5RFhLWj2N9rw+pMFzp7W2QDtD\nilN4jBRCXMqKI+u4mCQIsPkJb0gmNDzjH/TsQEqSMe26uJ5MCua8qbjReL0h\nvHKMFqZ+6/w4v1Rn0oYcNlE+OsJRUgDF7X9jzsZm8P4STVAIBPUpExyK7CfV\nWJsvDx1D+IwKc3i6djkFJfP2OK+uT4308/XvvZ/lMqi3Q/b12tzelH2PBbaz\ntg7dCyyQ87tiq8/bPDcWthlbD+I8Ypyq1HTV1RFOP7XgK4LdptYcCliZMYGs\ncDoHbTKPWbd28sTavZ2Z/ReaTTRQZEtrajZcAd+rA5CEfNft7pj2vY3eqUDO\nTn8uI7zVL0YKtUSM+P5WInlSwBRDZM7uwcCtlmg8J/dbkQFer4QH1CYuOrcY\nVzqsJ0XjsbbesgCWrFY5eQwr2/GVwDwb5dUMtSEJ4jxaRPiYTjbiN091x49J\nCFfRLALzZtWLGc5uhVoP1s9hmvE0KmFzoGNpOraFxlOCjrAquGF3wjtGdN+3\nb1qbC6It/Sut1Qpa4Mkl5zE5m9SjWQ5v1H+c1kazqY6QILprDzQfAq7z0/rI\nlBzu\r\n=Wvqf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOUonV+h7S7Lh5hA1w2rOtxN+7Ts35/sTO2rvYn8P9lgIhAImzzxn4UwddxuhpkNXW+UP8EizSaCWeZ8f7Ae2rN0s9"}]},"maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ed2curve_0.3.0_1579202228638_0.19859664113275488"},"_hasShrinkwrap":false}},"readme":"ed2curve.js\n===========\n\nConvert Ed25519 signing key pair into Curve25519 key pair suitable for\nDiffie-Hellman key exchange. This means that by exchanging only 32-byte\nEd25519 public keys users can both sign and encrypt with NaCl.\n\nNote that there's currently [no proof](http://crypto.stackexchange.com/a/3311/291)\nthat this is safe to do. It is safer to share both Ed25519 and Curve25519\npublic keys (their concatenation is 64 bytes long).\n\nWritten by Dmitry Chestnykh in 2014-2016, using public domain code from\n[TweetNaCl.js](https://github.com/dchest/tweetnacl-js). Public domain.\nNo warranty.\n\nThanks to [@CodesInChaos](https://github.com/CodesInChaos) and\n[@nightcracker](https://github.com/nightcracker) for showing how to\nconvert Edwards coordinates to Montgomery coordinates.\n\n[![Build Status](https://travis-ci.org/dchest/ed2curve-js.svg?branch=master)\n](https://travis-ci.org/dchest/ed2curve-js)\n\n\nInstallation\n------------\n\nVia NPM:\n\n    $ npm install ed2curve\n\nor just download `ed2curve.js` or `ed2curve.min.js` and include it after\n[TweetNaCl.js](https://github.com/dchest/tweetnacl-js):\n\n```html\n<script src=\"nacl.min.js\"></script>\n<script src=\"ed2curve.min.js\"></script>\n```\n\nUsage\n-----\n\n### ed2curve.convertKeyPair(keyPair) -> convertedKeyPair | null\n\nConverts the given key pair as generated by\n[TweetNaCl.js](https://github.com/dchest/tweetnacl-js)'s `nacl.sign.keyPair`\ninto a key pair suitable for operations which accept key pairs generated by\n`nacl.box.keyPair`. This function is a combination of `convertPublicKey`\nand `convertSecretKey`.\n\nReturns `null` if the public key in the given key pair is not a valid\nEd25519 public key.\n\n### ed2curve.convertPublicKey(edPublicKey) -> curvePublicKey | null\n\nConverts a 32-byte Ed25519 public key into a 32-byte Curve25519 public key\nand returns it.\n\nReturns `null` if the given public key in not a valid Ed25519 public key.\n\n### ed2curve.convertSecretKey(edSecretKey) -> curveSecretKey\n\nConverts a 64-byte Ed25519 secret key (or just the first 32-byte part of it,\nwhich is the secret value) into a 32-byte Curve25519 secret key and returns it.\n\n\nExample\n-------\n\n(Note: example uses [tweetnacl-util](https://github.com/dchest/tweetnacl-util-js)\nto convert bytes)\n\n```javascript\n// Generate new sign key pair.\nvar myKeyPair = nacl.sign.keyPair();\n\n// Share public key with a peer.\nconsole.log(myKeyPair.publicKey);\n\n// Receive peer's public key.\nvar theirPublicKey = // ... receive\n\n// Sign a message.\nvar message = nacl.util.decodeUTF8('Hello!');\nvar signedMessage = nacl.sign(message, myKeyPair.secretKey);\n\n// Send message to peer. They can now verify it using\n// the previously shared public key (myKeyPair.publicKey).\n// ...\n\n// Receive a signed message from peer and verify it using their public key.\nvar theirSignedMessage = // ... receive\nvar theirMessage = nacl.sign.open(theirSignedMessage, theirPublicKey);\nif (theirMessage) {\n  // ... we got the message ...\n}\n\n// Encrypt a message to their public key.\n// But first, we need to convert our secret key and their public key\n// from Ed25519 into the format accepted by Curve25519.\n//\n// Note that peers are not involved in this conversion -- all they need\n// to know is the signing public key that we already shared with them.\n\nvar theirDHPublicKey = ed2curve.convertPublicKey(theirPublicKey);\nvar myDHSecretKey = ed2curve.convertSecretKey(myKeyPair.secretKey);\n\nvar anotherMessage = nacl.util.decodeUTF8('Keep silence');\nvar encryptedMessage = nacl.box(anotherMessage, nonce, theirDHPublicKey, myDHSecretKey);\n\n// When we receive encrypted messages from peers,\n// we need to use converted keys to open them.\n\nvar theirEncryptedMessage = // ... receive\nvar decryptedMessage = nacl.box.open(theirEncryptedMessage, nonce, theirDHPublicKey, myDHSecretKey);\n```\n\nRequirements\n------------\n\n* Requires [TweetNaCl.js](https://github.com/dchest/tweetnacl-js)\n* Works in the same enviroments as it.\n\n\nOther libraries\n---------------\n\nSome other libraries that can use a single Ed/Curve25519 key:\n\n* [agl/../extra25519](https://github.com/agl/ed25519/blob/master/extra25519/extra25519.go) - Go\n  (compatible with ed2curve)\n* [CodesInChaos/../MontgomeryCurve25519](https://github.com/CodesInChaos/Chaos.NaCl/blob/master/Chaos.NaCl/MontgomeryCurve25519.cs) - C#\n  (compatible with ed2curve)\n* [nightcracker/ed25519](https://github.com/nightcracker/ed25519/blob/master/src/key_exchange.c) - C\n  (compatible with ed2curve)\n* [libsodium](https://github.com/jedisct1/libsodium) - C\n  (compatible with ed2curve)\n* [trevp/../curve_sigs](https://github.com/trevp/ref10_extract/blob/master/ed25519/additions/curve_sigs.c) - C\n  (incompatible, as it converts the opposite way, and stores a sign bit of signing public key in a signature)\n","maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"time":{"modified":"2022-06-16T05:02:13.189Z","created":"2014-08-03T20:07:19.248Z","0.1.1":"2014-08-03T20:07:19.248Z","0.1.2":"2014-09-03T12:33:44.857Z","0.1.3":"2014-09-03T12:59:33.895Z","0.1.4":"2016-02-20T16:18:52.011Z","0.2.0":"2016-12-21T11:07:51.434Z","0.2.1":"2016-12-21T11:16:11.006Z","0.3.0":"2020-01-16T19:17:08.806Z"},"homepage":"https://github.com/dchest/ed2curve-js","keywords":["ed25519","curve25519","djb","crypto","public","keys","edwards","montgomery","elliptic"],"repository":{"type":"git","url":"git+https://github.com/dchest/ed2curve-js.git"},"author":{"name":"Dmitry Chestnykh"},"bugs":{"url":"https://github.com/dchest/ed2curve-js/issues"},"license":"Unlicense","readmeFilename":"README.md"}