Hi all,
Never had the opportunity to use N/crypto, but not finding it useful for anything other than ‘UNEXPECTED_ERROR’s……
Code:
require([‘N/crypto’, ‘N/encode’], function(crypto, encode) {
var skey = crypto.createSecretKey({
encoding: encode.Encoding.HEX,
guid: ‘264CFB2D225B2D76FB94D150207E49DF’
});
var cipher = crypto.createCipher({algorithm: crypto.EncryptionAlg.AES, key: skey, padding: crypto.Padding.NoPadding});
cipher.update({input: ‘password’, inputEncoding: encode.Encoding.UTF_8 });
var cipherPayload = cipher.final({
outputEncoding: encode.Encoding.UTF_8
});
})
Tried all sorts of combinations with encoding, no joy! Anybody got any working code?
This is a cached copy. Click here to see the original post.