UNPKG

@dotenvx/dotenvx-pro

Version:
10 lines (6 loc) 264 B
const { encrypt } = require('eciesjs') function encryptValue (value, publicKey) { const ciphertext = encrypt(publicKey, Buffer.from(value)) return Buffer.from(ciphertext, 'hex').toString('base64') // base64 encode ciphertext } module.exports = encryptValue