0
votes

I'm using AES to encrypt data and RSA public key to encrypt the AES key used to encrypt data.

I have encrypted the AES key with RSA in Java using RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING and now I would want to decrypt that RSA encrypted key in NodeJS app. Is it possible to decrypt that AES key?

So basically I'm looking for RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING equivalent in NodeJS. (I did look at Java's RSA/ECB/OAEPWithSHA-256AndMGF1Padding equivalent in Node.js but there isn't anything useful)

I looked at NodeJS Decipher and crypto.privateDecrypt but it seems that there is no equivalent for OAEPWITHSHA-256ANDMGF1PADDING in NodeJS

Do I need to change OAEPWITHSHA-256ANDMGF1PADDING to something that else, that could be decrypted in NodeJS?

1

1 Answers

0
votes

I ended up using RSA/ECB/OAEPPadding for Java side and crypto.constants.RSA_PKCS1_OAEP_PADDING for NodeJS. This implementation is as secure as my original one and doesn't require any third party libraries.