How to use the eciesjs.encrypt 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 / bot.js View on Github external
function doEncrypt (msg, bufKey) {
  if (msg == null) return msg
  if (typeof msg !== 'string') {
    try {
      msg = JSON.stringify(msg)
    } catch (e) {
      console.warn(e)
      msg = String(msg)
    }
  }
  return ecencrypt(bufKey.toString('hex'), Buffer.from(msg)).toString('base64')
}

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