29 May 2013

python pgp

$ sudo apt-get install python-pip
$ sudo pip install python-gnupg



ref >>> http://www.gefira.pl/blog/2011/04/11/securing-sec-walls-secrets-with-gnupg-and-python-gnupg/



import gnupg

gpg = gnupg.GPG(gnupghome='/home/testgpguser/gpghome')
with open('my-encrypted.txt.gpg', 'rb') as f:
    status = gpg.decrypt_file(f, passphrase='my passphrase', output='my-decrypted.txt')

print 'ok: ', status.ok
print 'status: ', status.status
print 'stderr: ', status.stderr
ref >> http://www.saltycrane.com/blog/2011/10/python-gnupg-gpg-example/

No comments:

Post a Comment

Terima kasih