![]() |
VOOZH | about |
The crypto.createCipheriv() method is an inbuilt application programming interface of the crypto module which is used to create a Cipher object, with the stated algorithm, key, and initialization vector (iv).
Syntax:
crypto.createCipheriv( algorithm, key, iv, options )Parameters: This method accepts four parameters as mentioned above and described below:
Return Value: It returns Cipher object.
The crypto.createCipheriv() method provides encryption functionalities in Node.js.
Example 1: Below examples illustrate the use of crypto.createCipheriv() method in NodeJs:
Output:
{ iv: 'fb1f4b0a7daaada6cae678df32fad0f0',
encryptedData: '41aad2618892aa3d1850d336ad15b50e' }
Example 2: Below examples illustrate the use of crypto.createCipheriv() method in NodeJs:
Output:
done
MfHwhG/WPv+TIbG/qM78qA==
We have a Cheat Sheet on Nodejs crypto methods where we covered all the crypto methods to check those please go through Node Crypto Module Complete Reference this article.