Python Asymmetric Encryption: Using pre-generated prv/pub keys?

Ok I found how to load it from twisted.conch. Ssh import keys as Keys import base64 public_key = """\ ---- BEGIN SSH2 PUBLIC KEY ---- Comment: "rsa-key-20101003" AAAAB3NzaC1yc2EAAAABJQAAAgEAi+91fFsxZ7k1UuudSe5gZoavwARUyZScCtdf WQ0ROoJC+XIqW5vVJfgmr+A1jLS5m4wNsrCqeyoX2B22T6iEwqVXrXt3QcbccKMu WkLKFK1h67q6Coc+3eOTmKrOuZbWc19YQgybdkR/GxF7XAbq4NCGNaCDtMOqX8Q2 L/a9fAYqVdTwg9trpcz3whNmdLk/B0edOABKuVX51UdLV+ZggK503+uAb1JiIIj0 mARwR/HNo4oRLMLf2PjuZsGVYYjJDdVJBU6AN4PUQSRRRPL4+YmsrLJb/TpfJeXA vj4KZMNJv15YXz7/iMZMKznDtr2RJX5wbSpuTUBNZveA7YiIHxvvvis38b/lX9SJ SYPfZ9CeQY6MvQgG2zwDTOOvKgOIB4sTGMXfcoxB8AF/QXOcxWFJkZoj36rvMd9n Po6szLjHXwcEUOUvvQfG4VvdQA0H5gGLHqYL1EehRsgi5qcCoFPaZW2K09ErKcS0 MbrLFjBkQ9KmqAM38bvM8UhCWAMA9VXOGHMxUHBV4Bir9alGS4VX0B8Y0b3dZ+7I MKkHMCwdEUJf7QVdGxGuSQtVsq8RZbIpk3g7wtv8f6I/iEC58ekdrH35tq5+1ilW dkk9+rrhUy4qrZ+HFi7AeemybpiumbSnebvnkMaIPAOo23V8C9BQ0iuxx4gIZf10 o+TPSK8= ---- END SSH2 PUBLIC KEY ----""" key_data = ''. Join(public_key.splitlines()2:-1)# remove begin, end tags and comment blob = base64. Decodestring(key_data) key = Keys.Key.

_fromString_BLOB(blob).

I can think of at least two relatively simple options Use OpenSSL (or pyOpenSSL) to convert the BER to PEM Use paramiko, twisted or any other python SSH implementation to work with the keys directly.

I tried with twisted it worked with the private key but it raises a BadKeyError for the public key. – Zimm3r Oct 4 '10 at 5:55 Actually, if you have the private key, you can always produce the public key... – Kimvais Oct 4 '10 at 9:51 Well the app will have the public string embed in a string (same format as the file) but not the private key – Zimm3r Oct 4 '10 at 13:27.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions