Shailendra Pandey
Shailendra Pandey

Reputation: 355

Decrypting with same public key used for encryption in Java

I have a public key which is used to encrypt some binary data. How can I write the code that can decrypt this data with the same public key ?

Upvotes: 0

Views: 86

Answers (1)

piet.t
piet.t

Reputation: 11921

You can't - the whole point about public/private-key-cryptography like RSA is that when you encrypt some data using a public key you can only decrypt it using the matching (!) private key. So without the proper private key you won't be able to recover your AES-key and you won't get back to your cleartext.

Upvotes: 3

Related Questions