Created
July 16, 2012 18:41
-
-
Save lvidarte/3124234 to your computer and use it in GitHub Desktop.
created from lai
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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