can anyone help in decrypting retrieved value from...
# suitescript
s
can anyone help in decrypting retrieved value from a field in 2.0 ?
b
Depends on how you are encrypting it
And a little on what you are comparing it against
s
there is a input form of Current password where we need to validate what the user has entered and what we have already in a field are matching or not we need to validate.
in 1.0 we were using this. nlapiEncrypt(pwd, 'sha1');
b
there is no matching that in suitescript 2.0, you never could decrypt in suitescript 1 either
its a hash
one way
you can use N/crypto if you want to do your own hashing
but none of the crypto it implements is appropriate for anything resembling modern password appropriate hashes like bcrypt
s
ok, got it, can you help with how to do simple encrypt in 2.0 using SHA1 or SHA256
b
ill do it if you tell me which netsuite account you are doing this for so i know not to trust them with passwords
lmfao 1
s
this is custom app solution. that's why we need all these to happen on suitelet / restlet. and this custom password is also a custom field value not NS default login.
b
thats actually even worse, same condition, tell me which company this is for so i know who not to trust my passwords with
s
😐 thank you will figure it out, or re-verify the design.