[pycrypto] Verifying RSA signature generated by openssl

the2nd at otpme.org the2nd at otpme.org
Thu Oct 1 13:50:49 PDT 2015

Answering to myself as i figured it out now.

There are a lot of posts out there asking how to generate and verify 
openssh signatures with python but i haven't found one with a working 

So i answered to one: http://stackoverflow.com/a/32896372/5399159

Hope this helps someone....


On 2015-09-30 02:34, the2nd at otpme.org wrote:
> Hi,
> i would like to verify file signatures generated by pycrypto with
> openssl and vice versa.
> My test code is this: http://paste.ubuntu.com/12620657/
> This is working fine with pycrypto but when i try to verify the
> test.sig file with the following openssl command it fails:
> openssl pkeyutl -verify -sigfile test.sig -pubin -inkey pub.pem -in 
> test.txt
> If i generated a signature using openssl with the following command:
> openssl pkeyutl -sign -inkey priv.pem -in test.txt -out test.sig
> Verification with openssl works fine but not with pycrypto.
> openssl pkeyutl -verify -sigfile test.sig -pubin -inkey pub.pem -in 
> test.txt
> Signature Verified Successfully
> I've also tried to use PKCS1_PSS but this does not work too.
> Is there anything wrong with my code or is it not possible to verify
> openssl signatures?
> regards
> the2nd
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto

More information about the pycrypto mailing list