We are facing this issue intermittently on NodeJS(10.24) and node-forge (0.7.6).
at Object._decodePkcs1_v1_5 [as decode] (/finapp/EBPRD/SpeedUp/node_modules/node-forge/lib/rsa.js:1515:11)
at Object.key.decrypt (/finapp/EBPRD/SpeedUp/node_modules/node-forge/lib/rsa.js:1149:19)
we are encypting the data using
publicKey.encrypt(plainTxtData)
and we are trying to decrypt the data using below code.
var privateKeyRead = readPVKey()
var privateKey = forge.pki.privateKeyFromPem(privateKeyRead);
var symKey = privateKey.decrypt(request.body.symKey);
I tried to debug the code till rsa.js from where this generic error is thrown.
I tried to print the values of first, pub and bt. In case of success below are the values
rsa.js:first: 0
rsa.js:pub: false
rsa.js:bt: 2
When error occurs the values are as below.
rsa.js:first 174
rsa.js:pub: false
rsa.js:bt: 87
Is this issue coming because of the NodeJs (10.24) platform we are using ??
Do we need to encode or decode the String before and after encryption ??
Why this is coming intermittently ?? Out of 10 -15 time, it will come only once.
We are facing this issue intermittently on NodeJS(10.24) and node-forge (0.7.6).
we are encypting the data using
publicKey.encrypt(plainTxtData)
and we are trying to decrypt the data using below code.
I tried to debug the code till rsa.js from where this generic error is thrown.
I tried to print the values of first, pub and bt. In case of success below are the values rsa.js:first: 0 rsa.js:pub: false rsa.js:bt: 2
When error occurs the values are as below.
rsa.js:first 174 rsa.js:pub: false rsa.js:bt: 87
Is this issue coming because of the NodeJs (10.24) platform we are using ?? Do we need to encode or decode the String before and after encryption ?? Why this is coming intermittently ?? Out of 10 -15 time, it will come only once.
Thanks ..