Is it possible to encrypt with the RSA private key and decrypt with the RSA public key(not for signature) The task is that I have to encrypt the data with a private key. Transfer this data to another person and he decrypted it with a public key, added the data and encrypted it with the same public key and sent it to me. The whole task is written in Python, can there be any libraries for this?
1 Answer
The public key is public. You should consider that anybody can have a copy of it, including an attacker. By encrypting with a private key, anybody could decrypt the data with the public key, defeating the point of encrypting in the first place.
DO NOT DO IT.
-
$\begingroup$ Thank you for your attention, but in this project, this is exactly how the encryption technique is needed. $\endgroup$– FelixSep 9, 2021 at 9:04
-
$\begingroup$ It's impossible. If anyone can decrypt it, it's not encryption, by definition. You cannot encrypt anything with a private key. It's like asking how you can hide something by putting it in a clear glass box in the middle of Times Square. $\endgroup$ Sep 9, 2021 at 12:01
pow
directly. $\endgroup$