-
Hi Team we are facing below error : while decrypting signencrypted file generated using Bouncycastle library Error decrypting message: Session key decryption failed. Also same file we have tried with GPG tool: we received below detail: plz suggest what's wrong here in this file or our process gpg: encrypted with rsa3072 key, ID ###############, created 2021-10-26 GPG version : Please let us know how to fix this. below is our decryption code const messagedecrypt:any =fs.readFileSync("TESTPGP_PGPOUT", "utf8");
Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @varsha123 , the message has multiple security-relevant issues, which is why also GPG refuses to decrypt it by default. To get around the security checks that OpenPGP.js performs, you need to pass different configuration options to
you can pass While for:
use To apply the configuration, you can call openpgp.decrypt({
message,
verificationKeys: publicKey,
decryptionKeys: privateKey1,
config: { allowInsecureDecryptionWithSigningKeys: true, allowUnauthenticatedMessages: true }
}); |
Beta Was this translation helpful? Give feedback.
Hi @varsha123 , the message has multiple security-relevant issues, which is why also GPG refuses to decrypt it by default.
I recommend to upgrade/change encryption software since the encryption mechanism without integrity protection is being deprecated, and using signing keys for decryption is not safe with RSA keys.
To get around the security checks that OpenPGP.js performs, you need to pass different configuration options to
openpgp.decrypt
. Specifically, for :you can pass
config.allowUnauthenticatedMessages: true
-- find more details at #1418 and https://github.com/openpgpjs/openpgpjs/blob/main/src/config/config.js#L85-L93.While for: