Is their any solution to encrypt and decrypt strings in Netsuite using the a public key and private key?
Alternatively, how can I use the third-party Forge library with the RSA algorithm to encrypt and decrypt strings?
b
battk
04/17/2024, 7:51 AM
using node related modules typically comes down to bundling the module so that it uses amd (or umd)
battk
04/17/2024, 7:52 AM
and then polyfilling any missing globals that it expects
battk
04/17/2024, 7:52 AM
node forge is nice enough to already be packaged in umd
battk
04/17/2024, 7:53 AM
so you really only need to fill in missing globals, which can typically be found in error messages
battk
04/17/2024, 7:54 AM
if you are extra lucky, the error occurs while running the code instead of script evaluation, which means that you can use the script debugger to find the lines that throw errors
j
John
04/17/2024, 7:58 AM
Actually I am trying to decrypt the the encrypted string by using private key. But i am not getting any solution in suits answer and help.
Also i tried to n/crypto module.
But this module not support RSA algorithm. That support only AES symmetric cryptography.
b
battk
04/17/2024, 8:00 AM
your alternative of node forge is a reasonable solution
battk
04/17/2024, 8:07 AM
the one warning related to it is that it generally only works for smaller files, larger files are likely to hit execution/statement count limits