Skip to main content

Simple keyring backend using the file system and GPG to store credentials

Project description

GPG Keyring

Simple keyring implementation using gpg to store encrypted credentials on the file system.

Setup

  1. Install this package (f.e. into a virtual environment)

  2. Create the file as specified by keyring diagnose. The output should look similar to this:

     config path: <HOME-FOLDER>/.config/python_keyring/keyringrc.cfg
     data root: <HOME-FOLDER>/.local/share/python_keyring
    
  3. Use this snippet to configure this keyring backend as default:

     [backend]
     default-keyring=gpg_keyring.GpgKeyring
    
  4. Configure your e-mail address in the file ~/.gpg_keyring/gpg_keyring.conf:

     [settings]
     email = john.doe@domain.com
    

Now you should be able to use the gpg_keyring backend using commands like this:

  • keyring set <service> <username> to set a password
  • keyring get <service> <username> to retrieve the password
  • keyring del <service> <username> to delete an entry

Internals

Credentials and local settings are all stored in your home directory in the directory ~/.gpg_keyring/:

  • gpg_keyring.conf: configuration file for this plugin
  • <SHA256-hash>: credentials for the service. The service name is turned into a SAH-256 hash and used to as the name of the file containing the credentials.

The content of the credentials files is a base64 encoded cipher text of the following json structure:

    {
        "username": "<username>",
        "password": "<password>"
    }

... the user name <username> and the password <password> previously set via keyring set <service> <username> with the password <password> provided via stdin.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpg_keyring-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpg_keyring-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file gpg_keyring-0.1.1.tar.gz.

File metadata

  • Download URL: gpg_keyring-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gpg_keyring-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ef439f1ae60a0226d90deb7fcd299854cdbe7a7056ccf148955caf594aaeaff5
MD5 517c6568c946de9f77fad802f3c37106
BLAKE2b-256 d4e8bc87eaf73e801c1a03eec282ee7040e2ae83495408a4e0431a53221508fa

See more details on using hashes here.

File details

Details for the file gpg_keyring-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gpg_keyring-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gpg_keyring-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4cc2b7a4a71d5dc178ce3173b652082a93a6020a18815f2a573ce4859fdf13a
MD5 1b0f8ca7a09908b62613be2ce02f3199
BLAKE2b-256 b58c691f49a8c77aa2bf2561d4b3dc8ac1907241945e8e9630329a3e62eeebe7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page