Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
N/crypto anybody got any working code?
Hi all,
Never had the opportunity to use N/crypto, but not finding it useful for anything other than 'UNEXPECTED_ERROR's......
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?
0