If I don't want the receiver to know what I am encrypting, can I use RSA? I am embedding the encrypted information along with its HMAC in an image using steganography... then can I use the RSA algorithm?

For example: encrypt with my public key and decrypt with my private key when needed.
Is this good or should I use AES instead?

The purpose is that if the receiver leaks the data, I can prove that it belongs to me.

  • 1
    What are you trying to accomplish? That if the receiver modifies the image, that you can prove the image was modified? Commented Apr 6, 2017 at 9:49
  • 2
    You cannot prove that it belonged to you when you encrypt it with your public key, which everybody knowns. Non-repudiation is reached with digital signatures. Commented Apr 6, 2017 at 9:54
  • 1
    ... why not encrypt with your private key?
    – schroeder
    Commented Apr 6, 2017 at 10:03
  • 1
    and what will you do if someone slight modify the image? (just change the hue or something)
    – Serverfrog
    Commented Apr 6, 2017 at 12:38
  • 2
    Why do you need to embed the information in the image? Wouldn't it be a lot easier, if you just created a signature for the image and then created a proof-of-existence for that signature, like with a digital timestamp?
    – mat
    Commented Apr 12, 2017 at 9:37

2 Answers 2


You could embed the identifying data in the image, and then encrypt it with a private key (whether RSA or another asymmetric cryptosystem).

Then, everybody can use your public key to decrypt the information that you hid in the image... once you've told people it's there. This would prove that you had hidden some information in the image before it was leaked.

  • I'm sure there are still some issues with this, and that a more involved protocol is required to do this right. Haven't found it yet though. Commented Apr 6, 2017 at 10:03

What I understood is that you want to

1) Encrypt the data(dont want anybody to know its contents)

2) Give an assurance,i.e. a proof that it came from you.

Answer for 1) For encryption your data, you can use any symmetric or asymmetric algorithm. RSA obviously would be harder to break, at the same time it shall take more computing power to encrypt the data.

Answer for 2) For assurance, you can use ant asymmetric algorithm, again RSA would be best, BUT, the encryption has to be done by your PRIVATE key(not public key, since anybody can use your public key and it would not establish the fact that it was encrypted by you).

Combining both: You can use two rounds of encryption using different key pairs. First round (by asymmetric or symmetric) to ensure confidentiality and second round(by asymmetric) to ensure assurance.

Using RSA is good for both rounds, but to reduce the computation overhead you can use other encryption tools as well.


You can calculate HMAC, append it to your data and encrypt it using the public key of any asymmetric encryption technique(like RSA) or either key of any symmetric encryption technique. Asymmetric one would be more secured. HMAC will ensure the integrity and assurance that it came from you and the encrypted data would ensure its confidentiality.

Which approach of the above to be followed, depends totally upon your application and computation resources.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .