How to use the eciesjs.decrypt function in eciesjs

To help you get started, we’ve selected a few eciesjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TradaTech / icetea / web / playground.js View on Github external
function doDecrypt (privateKey, cipherText) {
  const plainText = decrypt(
    privateKey.toString('hex'),
    Buffer.from(cipherText, 'base64')
  ).toString()
  try {
    return JSON.parse(plainText)
  } catch (e) {
    console.warn(e)
    return plainText
  }
}

eciesjs

Elliptic Curve Integrated Encryption Scheme for secp256k1/curve25519

MIT
Latest version published 3 days ago

Package Health Score

80 / 100
Full package analysis

Popular eciesjs functions