Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

bachew/gpgedit

Repository files navigation

GpgEdit

GpgEdit uses GnuPG to encrypt your secrets into a simple gpg file.

This repo is no longer maintained

Installation

You can install from PyPI:

$ pip install gpgedit

Or from zip URL:

pip install https://github.com/bachew/gpgedit/archive/master.zip

Or install from cloned repo:

git clone https://github.com/bachew/gpgedit.git
pip install gpgedit

Usage

To create new encrypted gpg:

$ gpgedit tmp/x
New file 'tmp/x' will be created
Enter passphrase:
Confirm passphrase (1/2):
Confirm passphrase (2/2):
kwrite '/dev/shm/x.op36kgx8/x'
...
Encrypting '/dev/shm/x.op36kgx8/x' to 'tmp/x'
gpg --batch --yes -a --cipher-algo AES256 -c --passphrase-file /dev/shm/x.op36kgx8/passphrase.7zlszwz2 -o tmp/x /dev/shm/x.op36kgx8/x
Reading passphrase from file descriptor 3
Saved 'tmp/x'

To edit:

$ gpgedit tmp/x
Enter passphrase:
Decrypting 'tmp/x' to '/dev/shm/x.d059kzze/x'
gpg --batch --yes --passphrase-file /dev/shm/x.d059kzze/passphrase.dsl_gwa6 -o /dev/shm/x.d059kzze/x tmp/x
Reading passphrase from file descriptor 3
gpg: AES256 encrypted data
gpg: encrypted with 1 passphrase
kwrite '/dev/shm/x.d059kzze/x'
...
Encrypting '/dev/shm/x.d059kzze/x' to 'tmp/x'
gpg --batch --yes -a --cipher-algo AES256 -c --passphrase-file /dev/shm/x.d059kzze/passphrase.kbp9kerp -o tmp/x /dev/shm/x.d059kzze/x
Reading passphrase from file descriptor 3
Saved 'tmp/x'
kwrite(3077) KDirWatch::removeFile: doesn't know "/dev/shm/x.d059kzze/x"
Remove '/dev/shm/x.d059kzze'

Notice the output is verbose and there's no way to turn it off so that you see how it works everytime. Please take a look at gpgedit.py knowing that GpgEdit doesn't send your secrets somewhere else!

Development

To setup development environment, clone the repo, run init.py and activate virtual environment:

$ python3 init.py
$ pipenv shell
$ gpgedit -h

tmp is listed in .gitignore, create it for use in testing:

$ mkdir tmp

Run inv test to run unit tests on Python 2.7 and 3.

Lastly, some manual tests:

# Create new gpg file
$ gpgedit tmp/x.gpg

# Create new gpg file without changes
$ gpgedit tmp/y.gpg

# Edit existing gpg file
$ gpgedit tmp/x.gpg

# Edit but without changes
$ gpgedit tmp/x.gpg

To build package:

$ inv build

To generate README.html:

$ inv gen-readme

To upload package:

$ inv upload

Everything in one command:

$ inv all