gpglib2


Namegpglib2 JSON
Version 0.5.1 PyPI version JSON
download
home_page
SummaryA python3 compatible fork of gpglib, a Library for decrypting gpg that doesn't shell out to gpg
upload_time2024-01-08 00:29:46
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords decrypt gpg
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            GPGLib2
=======

This is a Python3 compatible fork of the gpglib library with support for AES
secret keys and the mdc packet types.

History
-------

Back in 2012 we couldn't find a library for decrypting gpg that didn't shell out
to gpg.

And shelling out to gpg is slow when you do it for many small files.

So, with the help of http://pypi.python.org/pypi/OpenPGP and PyCrypto we created
this, which is more performant than shelling out.

Then in 2017 a friend needed this library for a task, but the library wasn't
compatible with python3. Unfortunately we couldn't get write access back to the
original gpglib, so we have created a fork.

ChangeLog
---------

0.5.1 - 8 January 2024
  * Update pycryptodome

0.5.0 - 2 December 2023
  * Update to hatchling
  * Now supports python 3.8 to 3.12
  * Changed to MIT license

0.4.0 - 6 December 2020
  * gpglib2 now only supports python3.6 and above
  * Formatting and linting with black and pylama
  * Upgraded dependencies

0.3.1 - 1 September 2018
  * Update pycryptodome for CVE-2018-15560
  * Remove use of a private method in pycryptodome when decrypting session keys

0.3 - 4 August 2018
  * Migrated from pycrypto to pycryptodome

0.2.1 - 7 February 2018
  * performance enhancement

0.2 - 28 Jan 2018
  * Fork and python3 compatibility

Installing
==========

To install, pip::

    $ python -m pip install gpglib2

Or download from pypi: http://pypi.python.org/pypi/gpglib2.

Or clone the git repo: https://github.com/delfick/gpglib2.

Making test data
================

This is what I did to get the data in tests/data.

From within tests/data::

    $ gpg --full-gen-key --homedir ./gpg
    # Once with RSA encrypt and sign, username Stephen and password "password25"
    # And again with DSA/Elgamal, username Bobby and password "password25"

Then find the keyid::

    $ gpg --homedir ./gpg --list-keys
      ------------------------------------------------------------------------
      pub   rsa2048 2018-08-03 [SC]
            F93E6E1B45D1C037B42650DE52320610E94B004B
      uid           [ultimate] Stephen <stephen@stephen.com>
      sub   rsa2048 2018-08-03 [E]

      pub   dsa2048 2018-08-03 [SC]
            A02F07AF335D3212FEB29C44FF5D18CBDBE4C62B
      uid           [ultimate] Bobby <bobby@bobby.com>
      sub   elg2048 2018-08-03 [E]

    # Here, the key we want is "F93E6E1B45D1C037B42650DE52320610E94B004B"

Then with that keyid export the secret and public keys for both the rsa and dsa keys::

    $ export KEY=F93E6E1B45D1C037B42650DE52320610E94B004B
    $ gpg --export $KEY > keys/key.public.rsa.gpg
    $ gpg --export-secret-key $KEY > keys/key.secret.rsa.gpg

I then created dump.small and dump.big as random json structures (the big on is from http://json.org/example.html).

Then run ``./tests/data/generate_test_data.sh`` to generate messages in the
``tests/encrypted`` folder. 

Note that this is only necessary if you are editing ``generate_test_data.sh`` to
accommodate different options. If you are doing this then you will also need
to do the same to ``tests/test_decryption.py`` to take the different data into
account.

Tests
=====

Run::

  > ./test.sh

Currently not much is tested.

You may also use tox::

  > source run.sh activate
  > tox

Docs
====

Run::

  > ./run.sh docs view

Generated documentation is also available at: http://gpglib2.readthedocs.org/en/latest/

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gpglib2",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "decrypt,gpg",
    "author": "",
    "author_email": "Stephen Moore <stephen@delfick.com>",
    "download_url": "https://files.pythonhosted.org/packages/bc/7a/1cee2d1226865cef20180ae1522a9d386abb4d0cc7d83aeb01502db956b2/gpglib2-0.5.1.tar.gz",
    "platform": null,
    "description": "GPGLib2\n=======\n\nThis is a Python3 compatible fork of the gpglib library with support for AES\nsecret keys and the mdc packet types.\n\nHistory\n-------\n\nBack in 2012 we couldn't find a library for decrypting gpg that didn't shell out\nto gpg.\n\nAnd shelling out to gpg is slow when you do it for many small files.\n\nSo, with the help of http://pypi.python.org/pypi/OpenPGP and PyCrypto we created\nthis, which is more performant than shelling out.\n\nThen in 2017 a friend needed this library for a task, but the library wasn't\ncompatible with python3. Unfortunately we couldn't get write access back to the\noriginal gpglib, so we have created a fork.\n\nChangeLog\n---------\n\n0.5.1 - 8 January 2024\n  * Update pycryptodome\n\n0.5.0 - 2 December 2023\n  * Update to hatchling\n  * Now supports python 3.8 to 3.12\n  * Changed to MIT license\n\n0.4.0 - 6 December 2020\n  * gpglib2 now only supports python3.6 and above\n  * Formatting and linting with black and pylama\n  * Upgraded dependencies\n\n0.3.1 - 1 September 2018\n  * Update pycryptodome for CVE-2018-15560\n  * Remove use of a private method in pycryptodome when decrypting session keys\n\n0.3 - 4 August 2018\n  * Migrated from pycrypto to pycryptodome\n\n0.2.1 - 7 February 2018\n  * performance enhancement\n\n0.2 - 28 Jan 2018\n  * Fork and python3 compatibility\n\nInstalling\n==========\n\nTo install, pip::\n\n    $ python -m pip install gpglib2\n\nOr download from pypi: http://pypi.python.org/pypi/gpglib2.\n\nOr clone the git repo: https://github.com/delfick/gpglib2.\n\nMaking test data\n================\n\nThis is what I did to get the data in tests/data.\n\nFrom within tests/data::\n\n    $ gpg --full-gen-key --homedir ./gpg\n    # Once with RSA encrypt and sign, username Stephen and password \"password25\"\n    # And again with DSA/Elgamal, username Bobby and password \"password25\"\n\nThen find the keyid::\n\n    $ gpg --homedir ./gpg --list-keys\n      ------------------------------------------------------------------------\n      pub   rsa2048 2018-08-03 [SC]\n            F93E6E1B45D1C037B42650DE52320610E94B004B\n      uid           [ultimate] Stephen <stephen@stephen.com>\n      sub   rsa2048 2018-08-03 [E]\n\n      pub   dsa2048 2018-08-03 [SC]\n            A02F07AF335D3212FEB29C44FF5D18CBDBE4C62B\n      uid           [ultimate] Bobby <bobby@bobby.com>\n      sub   elg2048 2018-08-03 [E]\n\n    # Here, the key we want is \"F93E6E1B45D1C037B42650DE52320610E94B004B\"\n\nThen with that keyid export the secret and public keys for both the rsa and dsa keys::\n\n    $ export KEY=F93E6E1B45D1C037B42650DE52320610E94B004B\n    $ gpg --export $KEY > keys/key.public.rsa.gpg\n    $ gpg --export-secret-key $KEY > keys/key.secret.rsa.gpg\n\nI then created dump.small and dump.big as random json structures (the big on is from http://json.org/example.html).\n\nThen run ``./tests/data/generate_test_data.sh`` to generate messages in the\n``tests/encrypted`` folder. \n\nNote that this is only necessary if you are editing ``generate_test_data.sh`` to\naccommodate different options. If you are doing this then you will also need\nto do the same to ``tests/test_decryption.py`` to take the different data into\naccount.\n\nTests\n=====\n\nRun::\n\n  > ./test.sh\n\nCurrently not much is tested.\n\nYou may also use tox::\n\n  > source run.sh activate\n  > tox\n\nDocs\n====\n\nRun::\n\n  > ./run.sh docs view\n\nGenerated documentation is also available at: http://gpglib2.readthedocs.org/en/latest/\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A python3 compatible fork of gpglib, a Library for decrypting gpg that doesn't shell out to gpg",
    "version": "0.5.1",
    "project_urls": null,
    "split_keywords": [
        "decrypt",
        "gpg"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db54966afbc67a6db0a06c4069b70d0b249c551d895733fdfd04cb58dd5d464f",
                "md5": "97fdb725a8870e8ac9d02069e4f0e7c5",
                "sha256": "be3c9e61ada140d41ff23e687567c71b3082dba85287019f90af0e1c242bb34e"
            },
            "downloads": -1,
            "filename": "gpglib2-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "97fdb725a8870e8ac9d02069e4f0e7c5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19875,
            "upload_time": "2024-01-08T00:29:45",
            "upload_time_iso_8601": "2024-01-08T00:29:45.147463Z",
            "url": "https://files.pythonhosted.org/packages/db/54/966afbc67a6db0a06c4069b70d0b249c551d895733fdfd04cb58dd5d464f/gpglib2-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc7a1cee2d1226865cef20180ae1522a9d386abb4d0cc7d83aeb01502db956b2",
                "md5": "b58bf34aa6cb847781d5966cea08511d",
                "sha256": "9d2ca30d3048bf09651c5bf54ab117cf17e98c728b665546f583299585ad0242"
            },
            "downloads": -1,
            "filename": "gpglib2-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b58bf34aa6cb847781d5966cea08511d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 15212,
            "upload_time": "2024-01-08T00:29:46",
            "upload_time_iso_8601": "2024-01-08T00:29:46.337645Z",
            "url": "https://files.pythonhosted.org/packages/bc/7a/1cee2d1226865cef20180ae1522a9d386abb4d0cc7d83aeb01502db956b2/gpglib2-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-08 00:29:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gpglib2"
}
        
Elapsed time: 0.43295s