createCipheriv()

The node:crypto functions that encrypt (createCipheriv) and decrypt (createDecipheriv) data with a given algorithm, key and initialization vector.

In more detail

For AES-256-GCM, read the authentication tag with cipher.getAuthTag() after encrypting, and give it to decipher.setAuthTag() before decrypting. decipher.final() throws if the tag does not match, meaning the data was altered.

Related terms

Taught in

References