ANN: gnupg v0.2.0 released

Discussion in 'Python' started by Vinay Sajip, Jul 17, 2009.

  1. Vinay Sajip

    Vinay Sajip Guest

    A new version of the Python module which wraps GnuPG has been
    released.

    What Changed?
    =============
    The module was refactored slightly to support Python 3.0.

    The current version now passes all tests on Windows (Python 2.4, 2.5)
    and Ubuntu (Python 2.4, 2.5, 2.6 and 3.0).

    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) <>']},
    {
    ...
    'fingerprint': '37F24DD4B918CC264D4F31D60C5FEFA7A921FC4A',
    'keyid': '0C5FEFA7A921FC4A',
    'length': '1024',
    ...
    'uids': ['', 'Danny Davis (A test user) <>']}]
    >>> 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 = 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.
    Vinay Sajip, Jul 17, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vinay Sajip

    ANN: gnupg v0.2.1 released

    Vinay Sajip, Aug 8, 2009, in forum: Python
    Replies:
    0
    Views:
    467
    Vinay Sajip
    Aug 8, 2009
  2. Vinay Sajip

    ANN: python-gnupg v0.2.2 released

    Vinay Sajip, Oct 6, 2009, in forum: Python
    Replies:
    0
    Views:
    381
    Vinay Sajip
    Oct 6, 2009
  3. Vinay Sajip
    Replies:
    0
    Views:
    276
    Vinay Sajip
    Mar 1, 2010
  4. Vinay Sajip
    Replies:
    0
    Views:
    210
    Vinay Sajip
    Oct 14, 2010
  5. Vinay Sajip
    Replies:
    0
    Views:
    238
    Vinay Sajip
    Apr 10, 2011
Loading...

Share This Page