Skip to main content

GPG Password Manager

Project description

Welcome to ppass

GPG Password Manager

ppass is heavily inspired from pass

I wanted to extend some of its functionnalities, and decided to rewrite the application in Python. It was a good exercice to try Python as I am more used to program in js/ts and c++/qt.

This beeing said, ppass is not as well tested or stable as pass. I intend to make it evolve in the future, as I am using it on a daily basis. I am however alone on this one. If you want stability and portability, with a great community, please use pass.

Stores created with ppass are compatible with pass. They are thus also compatible with pass clients like Android Password Store.

Main features

  • gpg password creation (one file per password)
  • enhanced password file with username, url and comments
  • git integration
  • possibility to handle several distinct stores
  • open web browser from password file
  • automatic fill in username and password to web browser
  • cli user interface or json response
  • cli commands shortcuts for fast access to passwords
  • commands and params autocompletion

Roadmap

  • enhanced filter
  • enhanced clip functionnality
  • test on other platforms
  • code cleaning
  • more to come...

Installation

Requirements

The application is developped and used on ubuntu 21.10, with python 3.9.7. Any feedback on other platforms is welcomed.

  • python3 >=3.6.2,<4.0
  • xdotool: sudo apt install xdotool
  • git: sudo apt install git
  • gpg: sudo apt install gnupg
  • nano: sudo apt install nano
  • xclip: sudo apt install xclip

Install from pypi

pip install ppass

For an isolated environment with pipx:

pipx install ppass

Install from deb package

A deb package is available, built using dh-virtualenv. Installing this package will create a new Python virtual environment in opt/venvs. It will then create the symlink usr/bin/ppass pointing to opt/venvs/ppass/bin/ppass.

Note that dh-virtualenv built packages are dependent of python version. Use this only if you have default python version installed:

  • ubuntu bionic 18.04: Python 3.6
  • ubuntu focal 20.04: Python 3.8
  • ubuntu hirsute 21.04: Python 3.9
  • ubuntu impish 21.10: Python 3.9

Download latest .deb file from the release page.

sudo dpkg -i ppass_1.1.4_{{os}}_amd64.deb

Usage

Initialise

Initialisation is required before using the application, to select GPG identity.

ppass init

A configuration file .ppassrc is created in the user home directory.

By default, passwords will be stored in ${HOME}/.ppass/ folder.

The --edit option will open configuration file in edit mode.

Create a folder

A folder needs to be created before creating a password file.

ppass folders create

# or

ppass folders create --name "${NAME}"

Create a new password

You can then create a new password file.

If you want a new password to be generated:

ppass generate

If you already know the password:

ppass insert

If the is only one folder, it will be selected by default. Otherwise the list of available folders will be prompted for selection.

Clip username and password

ppass open will open a new webbrowser with the saved url

ppass clip will copy and paste to the active window the username as well as the password : {username} {TAB} {password} {RETURN}

ppass user will copy username to clipboard

ppass pass will copy password to clipboard

In case a password is saved with your GPG identity, it will be prompted through a modal window.

Filter

Currently password filter is only done on the password name, not on the folder name.

A future enhancement will provide a better filter functionnality.

ppass <command> <anything> will filter displayed passwords based on anything value (name containing this value).

Add a new store

You can create several stores (config sections). Default store path is ${HOME}/.ppass-${NAME}/

ppass -c "${STORE}" init --new-section

You can also select path via the option --path. The folder will be created if it does not exist.

ppass -c "${STORE}" init --new-section --path "${PATH}"

Use a store

All functions can be used for a specific store by using the -c option from ppass application.

ppass -c "${STORE}" generate ...
ppass -c "${STORE}" insert ...
ppass -c "${STORE}" open ...
ppass -c "${STORE}" clip ...
# etc.

Initialise new git repository

You can initialise a new git repository in store path. It will set automatic git push for every password creation or modification. The git repository needs to be created on your platform before.

A default branch main is created.

ppass -c "${STORE}" init-git

You can also pass parameter through cli command:

ppass -c "${STORE}" init-git --repo "${REPO}" --user "${USER}" --mail "${EMAIL}"

Initialise from existing git repository

If the git repository already exists, you can restore it in the current store folder by adding the --pull option to init-git command.

It will download the latest commit from main branch. If the branch name is different, you can update it in the config file through ppass init --edit.

Publish to git

When a git repository is enabled, all changes to passwords will be pushed to remote. However, there will never be automatic pull to retrieve potential password changes from remote (from other application, computer, user, android app, aso.).

Automatic pull is not activated so that access to password remain fast.

It can be done manually through

ppass -c "${STORE} git pull"
  # or
ppass -c "${STORE} git sync" # pull then push

In case a remote change is done but not pulled, the automatic push on password modification will fail. A manual git sync will be required to merge local and remote.

Change output to JSON

Default application prints in the cli items in a user friendly way: tables, prompts, aso.

It is however possible to pass all required parameters through command options, and retrieve function results in JSON format.

ppass --json <command> ...

Shortcuts and Aliases

Application must give a fast access to passwords to be useful.

All commands can be called by shortcuts with their first letter(s):

  • g for generate
  • c for clip
  • o for open
  • ...

I personnaly also defined shortcuts in my home .bashrc file:

alias pp='ppass -c PRO'
alias ppc='ppass -c PRO clip'
alias ppo='ppass -c PRO open'
alias ppp='ppass -c PERSO'
alias pppc='ppass -c PERSO clip'
alias pppo='ppass -c PERSO open'

Build

Requirements

Commands

poetry install

# build deb
dpkg-buildpackage -us -uc
dpkg-buildpackage -Tclean

# build python package
python3 -m build

Dependencies

Python Libraries

Python Development Libraries

Author

Sébastien Guerri - github page

Issues

Contributions, issues and feature requests are welcome!

Feel free to check issues page. You can also contact me.

License

Copyright (C) 2022 Sebastien Guerri

ppass is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

ppass is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ppass. If not, see https://www.gnu.org/licenses/.

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

ppass-1.1.4.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

ppass-1.1.4-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file ppass-1.1.4.tar.gz.

File metadata

  • Download URL: ppass-1.1.4.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ppass-1.1.4.tar.gz
Algorithm Hash digest
SHA256 68e4107347be301b498572271196bf7065a1a3bcfc259bb8b9f265dc786d241f
MD5 454d4fd1d45fa7d4ed11f9dd683079e0
BLAKE2b-256 606300147d7526ceffe735ab6830791974aa35322dc1bd9be098060f890ece49

See more details on using hashes here.

File details

Details for the file ppass-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: ppass-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ppass-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 97c4e338bd57b15ee984621374e4fe59f792d8169c873f8ca75a999d8bc9320e
MD5 3208cacf5071424a5f1f41b804372cac
BLAKE2b-256 85219fe0f8319582b9a5aefde88842ae9d77d763760ce263ad0a23af84907e3c

See more details on using hashes here.

Supported by

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