Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ANN: A new version (0.2.7) of the Python module which wraps GnuPG hasbeen released.

Reply
Thread Tools

ANN: A new version (0.2.7) of the Python module which wraps GnuPG hasbeen released.

 
 
Vinay Sajip
Guest
Posts: n/a
 
      04-10-2011
A new version of the Python module which wraps GnuPG has been
released.

What Changed?
=============
This is a minor enhancement and bug-fix release. See the project
website ( http://code.google.com/p/python-gnupg/ ) for more
information. Summary:

Better support for status messages from GnuPG.
The ability to use symmetrix encryption.
The ability to receive keys from keyservers.
The ability to use specific keyring files instead of the default
keyring files.
Internally, the code to handle Unicode and bytes has been tidied up.

The current version passes all tests on Windows (CPython 2.4, 2.5,
2.6, 3.1, 2.7 and Jython 2.5.1) and Ubuntu (CPython 2.4, 2.5, 2.6,
2.7, 3.0, 3.1, 3.2). On Windows, GnuPG 1.4.11 has been used for the
tests.

What Does It Do?
================
The gnupg module allows Python programs to make use of the
functionality provided by the Gnu Privacy Guard (abbreviated GPG or
GnuPG). Using this module, Python programs can encrypt and decrypt
data, digitally sign documents and verify digital signatures, manage
(generate, list and delete) encryption keys, using proven Public Key
Infrastructure (PKI) encryption technology based on OpenPGP.

This module is expected to be used with Python versions >= 2.4, as it
makes use of the subprocess module which appeared in that version of
Python. This module is a newer version derived from earlier work by
Andrew Kuchling, Richard Jones and Steve Traugott.

A test suite using unittest is included with the source distribution.

Simple usage:

>>> import gnupg
>>> gpg = gnupg.GPG(gnupghome='/path/to/keyring/directory')
>>> gpg.list_keys()

[{
...
'fingerprint': 'F819EE7705497D73E3CCEE65197D5DAC68F1AAB2',
'keyid': '197D5DAC68F1AAB2',
'length': '1024',
'type': 'pub',
'uids': ['', 'Gary Gross (A test user) <(E-Mail Removed)>']},
{
...
'fingerprint': '37F24DD4B918CC264D4F31D60C5FEFA7A921FC4A',
'keyid': '0C5FEFA7A921FC4A',
'length': '1024',
...
'uids': ['', 'Danny Davis (A test user) <(E-Mail Removed)>']}]
>>> encrypted = gpg.encrypt("Hello, world!", ['0C5FEFA7A921FC4A'])
>>> str(encrypted)

'-----BEGIN PGP MESSAGE-----\nVersion: GnuPG v1.4.9 (GNU/Linux)\n
\nhQIOA/6NHMDTXUwcEAf
....
-----END PGP MESSAGE-----\n'
>>> decrypted = gpg.decrypt(str(encrypted), passphrase='secret')
>>> str(decrypted)

'Hello, world!'
>>> signed = gpg.sign("Goodbye, world!", passphrase='secret')
>>> verified = gpg.verify(str(signed))
>>> print "Verified" if verified else "Not verified"

'Verified'

For more information, visit http://code.google.com/p/python-gnupg/ -
as always, your feedback is most welcome (especially bug reports,
patches and suggestions for improvement). Enjoy!

Cheers

Vinay Sajip
Red Dove Consultants Ltd.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANN: A new version (0.3.2) of the Python module which wraps GnuPG hasbeen released. Vinay Sajip Python 0 01-17-2013 05:41 PM
ANN: A new version (0.3.1) of the Python module which wraps GnuPG hasbeen released. Vinay Sajip Python 0 09-01-2012 09:59 PM
ANN: A new version (0.2.8) of the Python module which wraps GnuPG hasbeen released. Vinay Sajip Python 0 09-02-2011 06:47 PM
ANN: A new version (0.2.5) of the Python module which wraps GnuPG hasbeen released. Vinay Sajip Python 0 10-14-2010 12:07 PM
ANN: A new version (0.2.4) of the Python module which wraps GnuPG hasbeen released. Vinay Sajip Python 0 03-01-2010 01:27 PM



Advertisments