I used Putty Key Generator to create a private key, called Putty-Private.ppk
. I can use this private key with Pageant and Putty to connect to the servers of my hosting provider.
Now, I want to connect to the server with xmlrpc based remote API. To do this I installed ezPyCrypto which is advised by many as an easy to use python encryption library. To test the encryption I wrote the following code:
mypass = "xxx"
fd = open("Putty-Private.ppk")
pubprivkey = fd.read()
fd.close()
k = ezPyCrypto.key(pubprivkey, passphrase = mypass)
dec = k.decString(enc)
But the system gives the following error in ezPyCrypto.key(...)
invocation:
CryptoKeyError: Attempted to import invalid key, or passphrase is bad
I am sure that passphrase is correct. So, I guess I cannot use the private key generator by Putty in ezPyCrypto. Is that right? What is the explanation for the reason of this error?