How to use the browserify-cipher/browser.createCipheriv function in browserify-cipher

To help you get started, we’ve selected a few browserify-cipher 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 AudiusProject / hedgehog / src / authentication.js View on Github external
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 }
  }