Wednesday, May 29, 2019

Externally Decrypt a Cypher Encrypted by Using SuiteScript Encrypt API

At this moment, NetSuite Encrypt API is designed to only allow a user to decrypt a cypher which was encrypted in NetSuite using the Encrypt API
By another words, a user can only decrypt a cypher with nlapiDecrypt() function while the cypher is encrypted in NetSuite with nlapiEncrypt().

Case Study:
A user encrypts a string using 256-bit AES algorithm in NetSuite using the nlapiEncrypt() function. This cypher should be passed into another application to be decrypted and used again.

Alternate Solution:
  1. Any JavaScript library (search on the Internet for the most suitable library) can be used to encrypt and decrypt the cypher. Such library may be uploaded into NetSuite when creating a new Script
  2. Pass the cypher to the desired destination.
  3. Use the same JavaScript library in the end destination to decrypt the cypher

Note: NetSuite is planning to provide encryption API that uses common AES or other algorithms that can be decrypted outside of NetSuite.

No comments:

Post a Comment