I have found a library about Elliptic Curve Cryptography in JavaScript. I have learned how to encrypt the message. But, I didn't find how to decrypt it to the original message.
The code for encryption:
var EC = require('elliptic').ec;
var ec = new EC('secp256k1');
var msg = "hello";
let myKey = ec.keyFromPrivate('29f3c33a550d3810e6b82b7b510672118aeabcf8b19e00172e4623cbf480d2b8');
const sig = myKey.sign(msg, 'base64');
var derSign = sig.toDER('hex');
console.log (derSign)
output:
3044022076e7fbf80454f764e346dd359eb7f2002802e68d30a689d77d6211aa2c6e9d7302201b5f35d92b8f4aefd5f69d9d21e3dfba75404e4d5a89e09239b2accf43ff6d63
I want to return the signature to hello
again. How I could do that, please?