Can support no_padding encryption ?
I hope that I can encrypt words with public key, but I find there isnt the scheme of no_padding.
could you describe what you want to do in more detail, I am afraid I don’t understand what you are looking for.
Unless used for very specific purposes, unpadded RSA is dangerously brittle.
For example, with a low entropy plaintext, an attacker can perform brute force encryptions until they arrive at a matching ciphertext, at which point they've recovered the plaintext.
Unless used for very specific purposes, unpadded RSA is dangerously brittle.
For example, with a low entropy plaintext, an attacker can perform brute force encryptions until they arrive at a matching ciphertext, at which point they've recovered the plaintext.
Yes,I agree with what your said. Indeed I use it for specific purpose. Now I am simulating a user logging of a website by reqwest. And the author of the website uses unpadded RSA. Here is the encrypted code of the website.

If I'm reading that correctly, it looks like it's vulnerable to exactly the sort of attack I'm describing where an attacker can brute force ciphertexts until they find one that matches.
If I'm reading that correctly, it looks like it's vulnerable to exactly the sort of attack I'm describing where an attacker can brute force ciphertexts until they find one that matches.
I guess that it seems that the author of the website doesn't have enough safety awareness, and the website only can be visited by vpn, so they may not pay much attention to it.
I am not sure this is something I want to add to the library tbh.
I am very sympathic to the challenge of matching others people code, even if it is insecure. I think the only way I would be okay with, would be an explicit feature like insecure-options or similar, which is turned off by default.
@tarcieri @str4d any thoughts?
I think it would be best to avoid having an API like this. Unpadded RSA is a classical source of vulnerabilities.
Thanks ! I have tried to implement it and it looks not difficult !
Closing for now. We could potentially provide a "hazmat" API for unpadded RSA, but that should probably be motivated by a good use case