-4

I am looking for a package in nodejs which can help in the encryption of data using the public key which has been generated using bouncy castle in java and the encrypted data will be decrypted in bouncy castle again. I already tried openpgp package of node, I am able to encrypt but it seems that there is some issue in decrypting the data in bouncy castle.

I won't be able to provide any code for example, so apologies for that and thanks in advance.

  • Q: Could you specify exactly what "openpgp package of node" - and version - you're trying? Q: More importantly: could you clarify exactly what you mean by "there is some issue in decrypting the data"??? Can you give any details about what BouncyCastle version you're using, and exactly how you're encrypting the data? – paulsm4 Apr 04 '22 at 17:43
  • I am not using bouncy castle of java, I used openpgp package of nodejs and encrypted the data but when we try to decrypt the data using bouncy caslte then we are getting errors, may be it is because of the difference in package. Bouncy castle in java encrypts data in different way than the openpgp package in nodejs. So I am looking for a package which can encrypt the data in such a way that the encrypted data can be later decrypted by the bouncy castle in java. – Renu Manhas Apr 05 '22 at 05:35
  • 1
    You're being hopelessly vague. Q: You're using [openpgp](https://www.npmjs.com/package/openpgp), correct? Q. How exactly did you encrypt the data? Show us some code. Q: How exactly are you decrypting the data? Again: there are *many* possible reasons for "incompatiblity" (including something as simple as your choice of cipher). Show us the relevant code. Most important: Q: *WHAT EXACTLY ARE THE ERRORS???* Please copy/paste the *EXACT ERROR TEXT* in your original post. – paulsm4 Apr 05 '22 at 16:18
  • There is no such package in node which is compatible with bouncy castle of JAVA. The way of encryption is different in both. That is the reason, I was not able to decrypt. – Renu Manhas May 09 '22 at 11:47
  • This is just wrong. BC and nodes openpgp package implement RFC4880, an open standard meant to ensure INTEROPERABILITY. If decryption doesn't work for you, then it is because you are using your libraries wrong. See https://tests.sequoia-pgp.org/ PGPainless is using BouncyCastle and is fine in terms of interoperability. – vanitasvitae Jun 05 '22 at 08:51

1 Answers1

0

Have you looked at openpgpjs?

Apologies if you mean that by "openpgp package of node".

vanitasvitae
  • 185
  • 8
  • There is no need to be sarcastic here, I posted my question, in a hope to get answers. Anyways, thanks to all for the time. – Renu Manhas May 09 '22 at 11:46
  • It wasn't my intention to be sarcastic. Your question is just not very precise, so I did my best to guess what you are meaning ¯\_(ツ)_/¯ – vanitasvitae May 10 '22 at 12:35