# Is this spin on RSA algorithm possible?

My main purpose of this question is that i do not want the receiver to know how to decrpyt the data which I included in the image using steganography. I wanted to use asymmetric type algorithm and not symmetric. Is it possible to create a system like RSA where instead of using public key of receiver to encrypt and private key of receiver to decrypt , I want to encrypt with receiver's public key and decryption is possible only with senders private key. I am trying accomplish ownership.

• If the receiver must not be able to decrypt the information, then what is the purpose of sending it? What are you trying to accomplish - perhaps you want to prove the authenticity of your message? Apr 26, 2017 at 12:37
• Yes authenticity and ownership
– Sana
Apr 26, 2017 at 13:02
• I think what you're looking for is a digital signature. Apr 26, 2017 at 13:07
• Just to be sure I understand you correctly, you want to encrypt a message, send it to a receiver who you don't want to be able to decrypt the message but would want to verify you are the sender of the message? Only sender can encrypt and decrypt the message? Apr 26, 2017 at 13:44
• Marko Vodopija Yes that is what i am looking for,
– Sana
Apr 26, 2017 at 13:50

I want to encrypt with receiver's public key and decryption is possible only with senders private key. I am trying accomplish ownership.

In RSA, private and public keys are mathematically tied together. You are mentioning senders private key and recieviers public key. These two are not related to each other and can't be used in a way you described.

What you can do is following (without going into too much details about each specific step):

1. Generate RSA key par (private and public) for sender and distribute public key to all participants
2. Generate symmetric key for sender and keep it secret to sender only
3. Encrypt the data with symmetric algorithm (AES for example) using the key generated in step 2.
4. Sign the ciphertext you got from step 3. with senders private key
5. Send signed ciphertext to the receiver
6. Receiver can verify the ciphertext came from sender by using senders public key to check the signature but cannot decrypt the ciphertext. Only sender has the key to decrypt the ciphertext.
7. For all subsequent messages go to step 3.

Please note there are many pitfalls in using cryptographic primitives. It's best to do research before you start writing the code. You can start here and here.