こんな感じのプログラムを実行すると、
memo.js
crypto = require("crypto");
plainText = 'abcdefghijklmnopqrstuvwxyz';
passowrd = 'WIdlbs9pDHoLnLo4xEnVKc1DKA0XUFS0';
alg = 'aes256'
encoding = 'base64' // 'binary' or 'hex'
cipher = crypto.createCipher(alg, passowrd);
cipheredText = cipher.update(plainText, 'utf8', encoding);
cipheredText += cipher.final(encoding);
decipher = crypto.createDecipher(alg, passowrd);
dec = decipher.update(cipheredText, encoding, 'utf8');
dec += decipher.final('utf8');
console.log('crypted: '+ cipheredText);
console.log('decrypted: ' + dec);
こんな感じになります。
% node memo.js
crypted: 6RM52ZdyXDsi+PtGBTB58L5SlgythPJfVlld2z65YPo=
decrypted: abcdefghijklmnopqrstuvwxyz