-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
cryptoIssues and PRs related to the crypto subsystem.Issues and PRs related to the crypto subsystem.
Description
- Version: v7+
- Platform: Win10x64
- Subsystem: crypto
crypto.privateDecrypt does not accept RSA_PKCS1_OAEP_PADDING and RSA_PKCS1_PADDING option.
Using either of them produces the following error:
Error: error:0408F090:rsa routines:PKEY_RSA_CTRL:illegal or unsupported padding mode
It does accept RSA_NO_PADDING, but when I decrypt an sha256 signature, it will produce a 256 character string, the final 64 characters contained the actual hash.
For example, I have to do the following to successfully decrypt and read the sha256 signature:
var signature = Crypto.publicDecrypt(
{
'key': SessionManager.PublicKey, //buffer
'padding': Constants.RSA_NO_PADDING
},
Buffer.from(ciphertext, 'hex')
).toString().substr(192);Everything works as expected when using privateDecrypt.
Metadata
Metadata
Assignees
Labels
cryptoIssues and PRs related to the crypto subsystem.Issues and PRs related to the crypto subsystem.