msg = "this is msg to encrypt"
pub_key = M2Crypto.RSA.load_pub_key('mykey.py') // This method is taking PEM file.
encrypted = pub_key.public_encrypt(msg, M2Crypto.RSA.pkcs1_padding)
Now I'm trying to provide a file containing a public key of the radix64 format as a parameter in this method and unable to get the expected result, that is, encryption using a public key of the radix64 format.
Is there any other method in the Python API that can encrypt msg with the public key after trying to use some kind of mechanism?
I get my public key from a public key server with some HTML packaging and in radix64 format. How to convert the public key so that it can be accepted by any encryption method?
jaysh
source
share