Created
November 23, 2018 14:10
-
-
Save dshulyak/bf51dd3eacde721d9104d8ec056a2e7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
alice = crypto.createECDH('secp256k1') | |
alice.setPrivateKey('a3a8441a4b5040b438223eb3b273b7c8d3d219f418df2ab9da03c7350f5601a9', 'hex') | |
bob = Buffer.from([4, 202, 191, 42, 27, 135, 133, 122, 201, 194, 207, 107, 136, 190, 242, 52, 229, 224, 20, 254, 233, 138, 194, 101, 9, 202, 37, 122, 237, 103, 143, 62, 28, 204, 159, 213, 185, 168, 60, 253, 145, 112, 153, 7, 2, 154, 113, 137, 71, 231, 53, 146, 209, 203, 219, 219, 142, 22, 115, 192, 199, 3, 24, 217, 152, 144, 176, 254, 186, 178, 137, 31, 37, 168, 176, 34, 18, 252, 177, 60, 231, 185, 53, 7, 76, 133, 215, 149, 78, 204, 137, 113, 171, 193, 181, 232, 224, 70, 214, 141, 213, 188, 22, 223, 49, 250, 199, 181, 200, 49, 115, 26, 26, 109, 174, 78, 124, 88]) | |
alice.computeSecret(bob.slice(0, 65)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment