I am converting an encryption script from PHP to JavaScript and am struggling...
The node.js cipher documentation is as follows:
crypto.createCipheriv(algorithm, key, iv)
Creates and returns a cipher object, with the given algorithm, key and iv.
The PHP openssl-encrypt documentation:
string openssl_encrypt ( string $data , string $method , string $password [, bool $raw_output = false [, string $iv = "" ]] )
PHP uses a password and and iv. Node only uses a password when no IV is used, otherwise you have to provide a key and an iv.
How would I convert my PHP function to node, when I'm using both, the password and iv.
I'm also unclear on what exactly the key represents... the node documentation states that the key and iv are calculated if only a password is provided.. is this what PHP does? If so, what does it do when I provide a password and an iv? Does it use the password as key?