Encrypte & Decrypte string in Node.js

I have tried to encrypte and decrypte string in Node.js recently.
There has many code examples at Internet, eg:

Run it in console commond but the following error has occurred.
Ummm….,that is weird,may be ‘base64’ encoding will not working with ‘aes192’..?
Anyway, the following code works fine for me.

And the console log.

Post Tagged with , , , ,