If you're trying to decrypt a string using nodejs, you will get this error if you're not using the proper input encoding and output encoding.
When doing decrypt, the input / output should be reverse of what was used during input.
var mykey = _crypt.createCipheriv('aes-256-cbc', key, iv);
var myNom = mykey.update(nom, 'utf8', 'hex')
myNom += mykey.final('hex');
console.log("myNom: ", myNom.toString())