Skip to content

Instantly share code, notes, and snippets.

@lvidarte
Created July 16, 2012 18:41
Show Gist options
  • Save lvidarte/3124234 to your computer and use it in GitHub Desktop.
Save lvidarte/3124234 to your computer and use it in GitHub Desktop.
created from lai
# decryptor.py
import os.path
from Crypto.PublicKey import RSA
PRIVATE_KEY = os.path.join(os.path.expanduser('~'), '.ssh/id_rsa')
def decrypt():
with open(PRIVATE_KEY, 'r') as prv_key:
decryptor = RSA.importKey(prv_key)
with open('/tmp/encripted-message', 'rb') as file:
decripted_data = decryptor.decrypt(file.read())
print decripted_data
if __name__ == '__main__':
decrypt()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment