I work with a service that uses raw RSA with a private key to sign the payload. Data is efficiently created using:
openssl rsautl -inkey private_key.pem -raw -sign
(Also, the result of private key encryption)
Unfortunately, in Pycrypto, the corresponding .verify() method only takes an argument to verify that the data against is returning true or false.
In openssl, this can be achieved using one of the following actions:
# Private key based openssl rsautl -inkey private_key.pem -raw -verify # Public key based openssl rsautl -inkey public_key.pem -pubin -raw -verify
How can I achieve the same functionality in Pycrypto?
(I understand the risks of a raw RSA. To mitigate some of these risks, a custom fill mechanism has been implemented, unfortunately, it is not possible to change the current implementation)
source share