With SHA1 algorithm being deprecated in 2021.2, do...
# suitescript
s
With SHA1 algorithm being deprecated in 2021.2, do we have any third party crypto libraries which returns same digest as nlapiEncrypt does? Have gone through couple of modules. All of them are returning consistent results and the result is different from the NS digest. We have major impact due to SHA1 deprecation and we are looking for like to like match logic which returns same result as NS SHA1 does.
b
s
Why do you need to keep using SHA1, in particular Netsuite’s deprecated version? Do you have pre-calculated hashes that you are comparing against?
s
@*scottvonduhn* Yes, we have pre-calculated hashes and we use it as external id to identify records from other system. Now if sha1 is deprecated, will be difficult to match the record.
s
Is the other system a different Netsuite account, or something else? Can the hashes be re-computed?
s
@scottvonduhn yes not NetSuite, it is Salesforce. We need an script to match the NetSuite nlapiEncrypt - SHA1 functionality
s
Okay, but just curious, did you compute the hashes in netsuite then set the external id field in Salesforce from that? Usually you want to use hashes to validate things, not as a method of mapping multiple inputs to a unique value. Salesforce sObjects also have their own unique 18 character internal Ids, why not store and use those instead?
If you really just want a mapping function, you should create your own so no one can deprecate it on you. Base it on a publicly available library/module as you can’t control what NetSuite does.
s
@scottvonduhn It was implemented long back in our integration. When NetSuite mentioned that sha1 will be deprecated, we noticed it and looking for backward compatible solution. Obv we should use any other algorithm or other library, but given we already have hashes with sha1 is there any way to get exact result as what nlapiEncrypt gives?
s
I think you may need to reach out to Netsuite support. Their API’s are not open source, so they are really the only ones who know how the
nlapiEncrypt
function works. It could be using Java / JVM libraries, as all SuiteScript code is transpiled and run in a JVM. It could even be completely custom code. Netsuite might be willing to tell you how it is implemented, but then again maybe not, as they might see that as compromising security.