Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41099

ANN: A new version (0.3.3) of the Python module which wraps GnuPG has been released.

X-Received by 10.224.189.78 with SMTP id dd14mr9982015qab.0.1363047288815; Mon, 11 Mar 2013 17:14:48 -0700 (PDT)
X-Received by 10.49.30.65 with SMTP id q1mr1048202qeh.18.1363047288756; Mon, 11 Mar 2013 17:14:48 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!dd2no826000qab.0!news-out.google.com!o5ni743qas.0!nntp.google.com!dd2no825996qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Mon, 11 Mar 2013 17:14:48 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=82.152.15.113; posting-account=3PSTgxAAAACRZBfTFqcrp20l4rsi4Aaz
NNTP-Posting-Host 82.152.15.113
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <11bbf737-b40c-46cc-b8e2-e0259e6945a4@googlegroups.com> (permalink)
Subject ANN: A new version (0.3.3) of the Python module which wraps GnuPG has been released.
From Vinay Sajip <vinay_sajip@yahoo.co.uk>
Injection-Date Tue, 12 Mar 2013 00:14:48 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:41099

Show key headers only | View raw


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:

Improved support for status messages from GnuPG.
Fixed list_keys to handle control characters.
Enabled fast random for tests.

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) <gary.gr...@gamma.com>']},
 {
  ...
  'fingerprint': '37F24DD4B918CC264D4F31D60C5FEFA7A921FC4A',
  'keyid': '0C5FEFA7A921FC4A',
  'length': '1024',
  ...
  'uids': ['', 'Danny Davis (A test user) <danny.da...@delta.com>']}]
>>> 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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

ANN: A new version (0.3.3) of the Python module which wraps GnuPG has been released. Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2013-03-11 17:14 -0700

csiph-web