Skip to content

Commit

Permalink
Merge branch 'feature/easy-install'
Browse files Browse the repository at this point in the history
  • Loading branch information
balos1 committed May 23, 2017
2 parents 45801fa + 7567eb8 commit 8c5098e
Show file tree
Hide file tree
Showing 20 changed files with 625 additions and 81 deletions.
104 changes: 104 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# editor files
.vscode
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.5-dev" # 3.5 development branch
- "3.6"
- "3.6-dev" # 3.6 development branch
- "3.7-dev" # 3.7 development branch
- "nightly" # currently points to 3.7-dev
before_install:
- sudo apt-get -qq update
- sudo apt-get install paperkey zbar-tools
# Show the current setuptools version
- python -c "import setuptools; print(setuptools.__version__)"
# Show the pytest version
- py.test --version
install:
- pip install .
# command to run tests
script:
- py.test tests/test_*.py
96 changes: 64 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,51 @@
# easy-gpg-to-paper

easy-gpg-to-paper aims to make exporting your secret gpg key to paper, and then restoring from paper, an easy and painless process.
It can export your key to qrcode(s), or it can export your key as a base64 encoded string(s). In the future the code will be cleaned
up, and more features added. Anyone who wants to help out is more than welcome.
It can export your key to qrcode(s), or it can export your key as a base64 encoded string(s). In the future the code will be cleaned
up, and more features added. Anyone who wants to help out is more than welcome.

Tested with python 2.7.12 and 3.5.2.

# Contributors

I would like to thank these projects and people for inspiration:

+ [paperkey](http://www.jabberwocky.com/software/paperkey/)
+ [pyqrencode](https://github.com/Arachnid/pyqrencode)
+ user @joostrijneveld for [this gist](https://gist.github.com/joostrijneveld/59ab61faa21910c8434c)
[![Build Status](https://travis-ci.org/cojomojo/easy-gpg-to-paper.svg?branch=master)](https://travis-ci.org/cojomojo/easy-gpg-to-paper)
[![Version number](https://img.shields.io/badge/version-v0.1.0-blue.svg)](https://img.shields.io/badge/version-v0.1.0-blue.svg)
[![Supports](https://img.shields.io/badge/python-2.7%2C%203.3%2C%203.4%2C%203.5%2C%203.6%2C%203.7--dev-blue.svg)](https://img.shields.io/badge/python-2.7%2C%203.3%2C%203.4%2C%203.5%2C%203.6%2C%203.7--dev-blue.svg)

# Dependencies

+ [paperkey](http://www.jabberwocky.com/software/paperkey/)
+ [libqrencode](http://fukuchi.org/works/qrencode/)
+ [zbarimg](http://zbar.sourceforge.net/)
+ [my fork of pyqrencode](https://github.com/cojomojo/pyqrencode)
+ [python-qrcode](https://github.com/lincolnloop/python-qrcode)
+ [Pillow](https://github.com/python-pillow/Pillow)

# Installation

### Ubuntu/Debian

# Setup and Usage
```
> sudo apt-get install paperkey zbar-tools && pip install pillow qrcode
> git clone https://github.com/cojomojo/easy-gpg-to-paper.git && cd easy-gpg-to-paper
> sudo cp gpg2paper/gpg2paper.py /usr/local/bin
```

### macOS

```
> brew install paperkey zbar && pip install pillow qrcode
> git clone https://github.com/cojomojo/easy-gpg-to-paper.git && cd easy-gpg-to-paper
> sudo cp gpg2paper/gpg2paper.py /usr/local/bin
```

1. Install the dependencies.
2. Clone/download the repository.
3. Add gpg2paper.py to your path and give it executable permissions.
# Usage

```bash
> gpg2paper.py
```
> ./gpg2paper.py
usage: gpg2paper.py {import,export} ...
import/export gpg key from/to qrcode(s) or base64 string(s)
positional arguments:
{import,export} commands
>
>gpg2paper.py import -h
> ./gpg2paper.py import -h
usage: gpg2paper.py import [-h] --pubkey PUBKEY [--png | --base64] --in
INFILE_NAMES [INFILE_NAMES ...]
IN_FILENAMES [IN_FILENAMES ...]
import gpg key from qrcode(s)/base64
Expand All @@ -49,33 +56,58 @@ optional arguments:
the secret key.
--png, -png Read the input file(s) as a png qrcode(s).
--base64, -b64 Read the input file(s) as a base64 string.
--in INFILE_NAMES [INFILE_NAMES ...], -i INFILE_NAMES [INFILE_NAMES ...]
--in IN_FILENAMES [IN_FILENAMES ...], -i IN_FILENAMES [IN_FILENAMES ...]
The name of the input file(s) in the correct order.
>
> gpg2paper.py export -h
usage: gpg2paper.py export [-h] --keyid KEYID [--numfiles NUMFILES] [--base64]
[--png] [--size SIZE] --out OUTFILE_NAME
> ./gpg2paper.py export -h
usage: gpg2paper.py export [-h] --keyid KEY_ID [--numfiles NUM_FILES]
[--base64] [--png] --out OUT_FILENAME
export gpg key to qrcode(s)
optional arguments:
-h, --help show this help message and exit
--keyid KEYID, -k KEYID
--keyid KEY_ID, -k KEY_ID
The gpg secret key ID to export.
--numfiles NUMFILES, -n NUMFILES
--numfiles NUM_FILES, -n NUM_FILES
The number of files to split the key into.
--out OUTFILE_NAME, -o OUTFILE_NAME
--out OUT_FILENAME, -o OUT_FILENAME
The base output file name.
--base64, -b64 Output the gpg key as a base64 string in a file(s).
--png, -png Output the gpg key as a png qrcode(s).
--size SIZE Height and width of png qrcode(s) in pixels.
--png, -png Output the gpg key as a png qrcode(s)..
```

# Security Considerations

The protection and encryption status of and security requirements for storing your secret key are not changed by easy-gpg-to-paper.
Passphrase protected keys are output in their passphrase protected form.

# Contributing

### Ubuntu/Debian

```
> sudo apt-get install paperkey zbar-tools && pip install pillow qrcode
> git clone https://github.com/cojomojo/easy-gpg-to-paper.git && cd easy-gpg-to-paper
> pip install . pytest
```

### macOS

```
> brew install paperkey zbar && pip install pillow qrcode
> git clone https://github.com/cojomojo/easy-gpg-to-paper.git && cd easy-gpg-to-paper
> pip install . pytest
```

Contributions are welcome with arms wide open.

# Credits

I would like to thank these projects and people for inspiration:

+ [paperkey](http://www.jabberwocky.com/software/paperkey/)
+ user @joostrijneveld for [this gist](https://gist.github.com/joostrijneveld/59ab61faa21910c8434c)

# License
MIT
Empty file added gpg2paper/__init__.py
Empty file.

0 comments on commit 8c5098e

Please sign in to comment.