Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static encrypt (entropy, ivBuffer, keyBuffer) {
let encryptFn = Cipher.createCipheriv(mode, keyBuffer, ivBuffer)
const entropyBuffer = createEncryptBuffer(entropy)
let cipherText = BufferSafe.concat([encryptFn.update(entropyBuffer), encryptFn.final()])
let cipherTextHex = cipherText.toString('hex')
return { cipherText: cipherText, cipherTextHex: cipherTextHex }
}