• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

docs/H03-May-2022-3,6692,698

examples/H01-Aug-2018-215112

pretty_bad_protocol/H01-Aug-2018-8,6506,742

.coveragercH A D01-Aug-2018721 3431

.gitattributesH A D01-Aug-201829 21

.gitignoreH A D01-Aug-20181.1 KiB9575

.travis.ymlH A D01-Aug-2018489 2318

CODE_OF_CONDUCT.mdH A D01-Aug-20183.1 KiB8162

CONTRIBUTING.mdH A D01-Aug-2018700 1913

LICENSEH A D01-Aug-201833.6 KiB663546

MANIFEST.inH A D01-Aug-2018248 1611

MakefileH A D01-Aug-20183.3 KiB160121

READMEH A D01-Aug-20182.7 KiB9567

README.rstH A D01-Aug-20182.7 KiB9567

TODOH A D01-Aug-20184.7 KiB10884

setup.cfgH A D01-Aug-2018192 139

setup.pyH A D01-Aug-20185.5 KiB160114

versioneer.pyH A D01-Aug-201825.2 KiB657528

README

1.. -*- coding: utf-8; mode: rst; -*-
2
3*******************************************************
4pretty-bad-protocol (a.k.a. python-gnupg) |On PyPI|
5*******************************************************
6
7Complete rewrite of `Vinay Sajip's python-gnupg <https://bitbucket.org/vinay.sajip/python-gnupg>`__,
8including patches to fix a shell injection vulnerability due to unsanitised
9inputs being passed to ``subprocess.Popen([...], shell=True)``.
10
11.. |On PyPI| image:: https://badge.fury.io/py/gnupg.png
12   :target: https://pypi.python.org/pypi/gnupg
13
14==============
15Installation
16==============
17
18----------------------------------------
19From `PyPI <https://pypi.python.org>`__
20----------------------------------------
21
22It's simple. Just do::
23
24    [sudo] pip install pretty-bad-protocol
25
26Additionally, the legacy way to install versions of this library <
273.0.0 is::
28
29    [sudo] pip install gnupg
30
31--------
32From git
33--------
34
35To install this package from this git repository, do::
36
37    git clone https://github.com/isislovecruft/python-gnupg.git
38    cd python-gnupg
39    make install
40    make test
41
42Optionally, to build the Sphinx documentation_, do::
43
44    make docs
45
46
47To get started using python-gnupg's API, see the documentation_,
48and import the module like so::
49
50.. code-block:: python
51
52    >>> from pretty_bad_protocol import gnupg
53
54The primary interface class you'll likely want to interact with is ``gnupg.GPG``:
55
56.. code-block:: python
57
58    >>> gpg = gnupg.GPG(binary='/usr/bin/gpg',
59    ...     homedir='./keys',
60    ...     keyring='pubring.gpg',
61    ...     secring='secring.gpg')
62    >>> batch_key_input = gpg.gen_key_input(
63    ...     key_type='RSA',
64    ...     key_length=4096)
65    >>> print batch_key_input
66    Key-Type: RSA
67    Name-Email: isis@wintermute
68    Key-Length: 4096
69    Name-Real: Autogenerated Key
70    %commit
71
72    >>> key = gpg.gen_key(batch_key_input)
73    >>> print key.fingerprint
74    245D8FA30F543B742053949F553C0E154F2E7A98
75
76    >>> message = "The crow flies at midnight."
77    >>> encrypted = str(gpg.encrypt(message, key.fingerprint))
78    >>> decrypted = str(gpg.decrypt(encrypted))
79    >>> assert decrypted == message
80
81.. _documentation: https://pythonhosted.org/gnupg/
82
83==============================
84Bug Reports & Feature Requests
85==============================
86
87Our bugtracker can be found `on Github
88<https://github.com/isislovecruft/python-gnupg/issues>`__.  Public comments and
89discussions are also welcome on the bugtracker.  Patches are always welcome.
90
91I increasingly have less and less time to deal with maintaining this
92module.  Please be patient, and if there is a patch your project
93urgently needs, please consider temporarily forking until I or one of
94the other maintainers can get to your issue.
95

README.rst

1.. -*- coding: utf-8; mode: rst; -*-
2
3*******************************************************
4pretty-bad-protocol (a.k.a. python-gnupg) |On PyPI|
5*******************************************************
6
7Complete rewrite of `Vinay Sajip's python-gnupg <https://bitbucket.org/vinay.sajip/python-gnupg>`__,
8including patches to fix a shell injection vulnerability due to unsanitised
9inputs being passed to ``subprocess.Popen([...], shell=True)``.
10
11.. |On PyPI| image:: https://badge.fury.io/py/gnupg.png
12   :target: https://pypi.python.org/pypi/gnupg
13
14==============
15Installation
16==============
17
18----------------------------------------
19From `PyPI <https://pypi.python.org>`__
20----------------------------------------
21
22It's simple. Just do::
23
24    [sudo] pip install pretty-bad-protocol
25
26Additionally, the legacy way to install versions of this library <
273.0.0 is::
28
29    [sudo] pip install gnupg
30
31--------
32From git
33--------
34
35To install this package from this git repository, do::
36
37    git clone https://github.com/isislovecruft/python-gnupg.git
38    cd python-gnupg
39    make install
40    make test
41
42Optionally, to build the Sphinx documentation_, do::
43
44    make docs
45
46
47To get started using python-gnupg's API, see the documentation_,
48and import the module like so::
49
50.. code-block:: python
51
52    >>> from pretty_bad_protocol import gnupg
53
54The primary interface class you'll likely want to interact with is ``gnupg.GPG``:
55
56.. code-block:: python
57
58    >>> gpg = gnupg.GPG(binary='/usr/bin/gpg',
59    ...     homedir='./keys',
60    ...     keyring='pubring.gpg',
61    ...     secring='secring.gpg')
62    >>> batch_key_input = gpg.gen_key_input(
63    ...     key_type='RSA',
64    ...     key_length=4096)
65    >>> print batch_key_input
66    Key-Type: RSA
67    Name-Email: isis@wintermute
68    Key-Length: 4096
69    Name-Real: Autogenerated Key
70    %commit
71
72    >>> key = gpg.gen_key(batch_key_input)
73    >>> print key.fingerprint
74    245D8FA30F543B742053949F553C0E154F2E7A98
75
76    >>> message = "The crow flies at midnight."
77    >>> encrypted = str(gpg.encrypt(message, key.fingerprint))
78    >>> decrypted = str(gpg.decrypt(encrypted))
79    >>> assert decrypted == message
80
81.. _documentation: https://pythonhosted.org/gnupg/
82
83==============================
84Bug Reports & Feature Requests
85==============================
86
87Our bugtracker can be found `on Github
88<https://github.com/isislovecruft/python-gnupg/issues>`__.  Public comments and
89discussions are also welcome on the bugtracker.  Patches are always welcome.
90
91I increasingly have less and less time to deal with maintaining this
92module.  Please be patient, and if there is a patch your project
93urgently needs, please consider temporarily forking until I or one of
94the other maintainers can get to your issue.
95