Domanda

I RSA encrypt an AES key using PyCrypto PKCS_OAEP. The OAEP uses SHA1 and MGF1 (defaults).

I am trying to get a Cipher instance in Java which matches my PyCrypto encryption param spec.

I see that the SHA1/MGF1 padding is fine, BUT totally unsure about the cipher mode. I assume it is ECB but can someone help here. Decryption is failing. I can provide the errors when I get to work, but till then there may be a trivial answer that will save any more discussion.

È stato utile?

Soluzione

Public key ciphers are not used in any mode of operation, so the technically correct term is "NONE", though the JCE does accept "ECB" as a synonym for legacy compatibility reasons. The string to pass to Cipher.getInstance() should be "RSA/NONE/OAEPWithSHA1AndMGF1Padding".

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top