{"_id":"ed2curve","_rev":"4579980","name":"ed2curve","description":"Convert Ed25519 signing keys into Curve25519 Diffie-Hellman keys.","dist-tags":{"latest":"0.3.0"},"maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"time":{"modified":"2026-04-10T15:56:45.000Z","created":"2014-08-03T20:07:19.248Z","0.3.0":"2020-01-16T19:17:08.806Z","0.2.1":"2016-12-21T11:16:11.006Z","0.2.0":"2016-12-21T11:07:51.434Z","0.1.4":"2016-02-20T16:18:52.011Z","0.1.3":"2014-09-03T12:59:33.895Z","0.1.2":"2014-09-03T12:33:44.857Z","0.1.1":"2014-08-03T20:07:19.248Z"},"users":{},"author":{"name":"Dmitry Chestnykh"},"repository":{"type":"git","url":"git+https://github.com/dchest/ed2curve-js.git"},"versions":{"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":{"shasum":"322b575152a45305429d546b071823a93129a05d","size":5911,"noattachment":false,"key":"/ed2curve/-/ed2curve-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ed2curve/download/ed2curve-0.3.0.tgz"},"maintainers":[{"name":"dchest","email":"dmitry@codingrobots.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ed2curve_0.3.0_1579202228638_0.19859664113275488"},"_hasShrinkwrap":false,"publish_time":1579202228806,"_cnpm_publish_time":1579202228806,"_cnpmcore_publish_time":"2021-12-16T13:02:21.030Z"},"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","size":9034,"noattachment":false,"key":"/ed2curve/-/ed2curve-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ed2curve/download/ed2curve-0.2.1.tgz"},"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"},"publish_time":1482318971006,"_hasShrinkwrap":false,"_cnpm_publish_time":1482318971006,"_cnpmcore_publish_time":"2021-12-16T13:02:21.395Z"},"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","size":8245,"noattachment":false,"key":"/ed2curve/-/ed2curve-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ed2curve/download/ed2curve-0.2.0.tgz"},"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"},"publish_time":1482318471434,"_hasShrinkwrap":false,"_cnpm_publish_time":1482318471434,"_cnpmcore_publish_time":"2021-12-16T13:02:21.799Z"},"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","size":4155,"noattachment":false,"key":"/ed2curve/-/ed2curve-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/ed2curve/download/ed2curve-0.1.4.tgz"},"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"},"publish_time":1455985132011,"_hasShrinkwrap":false,"_cnpm_publish_time":1455985132011,"_cnpmcore_publish_time":"2021-12-16T13:02:22.000Z"},"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","size":4140,"noattachment":false,"key":"/ed2curve/-/ed2curve-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/ed2curve/download/ed2curve-0.1.3.tgz"},"publish_time":1409749173895,"_hasShrinkwrap":false,"_cnpm_publish_time":1409749173895,"_cnpmcore_publish_time":"2021-12-16T13:02:22.232Z"},"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","size":4143,"noattachment":false,"key":"/ed2curve/-/ed2curve-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/ed2curve/download/ed2curve-0.1.2.tgz"},"publish_time":1409747624857,"_hasShrinkwrap":false,"_cnpm_publish_time":1409747624857,"_cnpmcore_publish_time":"2021-12-16T13:02:22.483Z"},"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","size":3869,"noattachment":false,"key":"/ed2curve/-/ed2curve-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ed2curve/download/ed2curve-0.1.1.tgz"},"publish_time":1407096439248,"_hasShrinkwrap":false,"_cnpm_publish_time":1407096439248,"_cnpmcore_publish_time":"2021-12-16T13:02:22.719Z"}},"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","_attachments":{},"homepage":"https://github.com/dchest/ed2curve-js","bugs":{"url":"https://github.com/dchest/ed2curve-js/issues"},"license":"Unlicense"}