Giter Site home page Giter Site logo

balos1 / easy-gpg-to-paper Goto Github PK

View Code? Open in Web Editor NEW
81.0 81.0 11.0 62 KB

easy-gpg-to-paper aims to make exporting your secret gpg key to paper, and then restoring from paper, an easy and painless process.

Python 100.00%
gpg privacy qrcode security

easy-gpg-to-paper's Introduction

I am a computational scientist and research software engineer in the Center for Applied Scientific Computing (CASC) at Lawrence Livermore National Laboratory. My work focuses on the research and development of scalable numerical algorithms and software for high-performance scientific computing. I am a core developer of the SUNDIALS project. I have experience working with a wide variety of scientific applications including ones from combustion, nuclear physics and fusion energy science.

๐ŸŽ“ My Google Scholar Profile

๐Ÿ  My Home Page

easy-gpg-to-paper's People

Contributors

balos1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

easy-gpg-to-paper's Issues

non-zero exit status 4

I'm getting a non-zero exit status 4 error.

Probably due to my incompetence.
I'm trying to import 2 png's that I just made with the export tool.

gpg2paper.py import --pubkey mykey.asc --png --in tryout1.png tryout2.png

after which I get:

`scanned 0 barcode symbols from 1 images in 1 seconds

WARNING: barcode data was not detected in some image(s)
things to check:
- is the barcode type supported? currently supported symbologies are:
EAN/UPC (EAN-13, EAN-8, UPC-A, UPC-E, ISBN-10, ISBN-13),
Code 128, Code 39 and Interleaved 2 of 5
- is the barcode large enough in the image?
- is the barcode mostly in focus?
- is there sufficient contrast/illumination?

Traceback (most recent call last):
File "/usr/local/bin/gpg2paper.py", line 274, in
sys.exit(main())
File "/usr/local/bin/gpg2paper.py", line 109, in main
do_import(args)
File "/usr/local/bin/gpg2paper.py", line 122, in do_import
base64str = read_chunks_png(args.in_filenames)
File "/usr/local/bin/gpg2paper.py", line 151, in read_chunks_png
chunk = subprocess.check_output(['zbarimg', '--raw', in_filename])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
`

Any ideas about what I'm doing wrong?
And thanks for making this tool!

CRC of secret does not match

Steps to reproduce:

  1. Create an export of a key
./gpg2paper/gpg2paper.py export --keyid 0EEA0F23C0051DFFE1AD5CF408DDAA857B879A26 --png --out 0EEA0F23C0051DFFE1AD5CF408DDAA857B879A26
  1. Investigate created barcode files
$ ls -la *.png
-rw-rw-rw- 1 gun gun 3396 Jan  4 16:50 0EEA0F23C0051DFFE1AD5CF408DDAA857B879A261.png
-rw-rw-rw- 1 gun gun 3419 Jan  4 16:50 0EEA0F23C0051DFFE1AD5CF408DDAA857B879A262.png
-rw-rw-rw- 1 gun gun 3472 Jan  4 16:50 0EEA0F23C0051DFFE1AD5CF408DDAA857B879A263.png
-rw-rw-rw- 1 gun gun 3293 Jan  4 16:50 0EEA0F23C0051DFFE1AD5CF408DDAA857B879A264.png
  1. Delete key from local keyring for testing the import
gpg --delete-secret-and-public-keys 0EEA0F23C0051DFFE1AD5CF408DDAA857B879A26
  1. Try to import from qrcode files
./gpg2paper/gpg2paper.py import --pubkey /mnt/c/users/gun/gpg_key.pub --png --in *.png
scanned 1 barcode symbols from 1 images in 0.28 seconds

scanned 1 barcode symbols from 1 images in 0.24 seconds

scanned 2 barcode symbols from 1 images in 0.24 seconds

scanned 1 barcode symbols from 1 images in 0.2 seconds

CRC of secret does not match (5CBB88!=5A5099)
Unable to read secrets file

Support import of multiple barcodes in single png

Steps to prepare:

  1. Export the key to png
./gpg2paper.py export --keyid 123213232 --png --out ~/.gnupg/123213232.png
  1. Place the created barcodes into a single paper (using imagemagick)
montage -mode concatenate -tile 2x ~/.gnupg/123213232.png* ~/.gnupg/123213232-full.png
  1. Import the created image
./gpg2paper.py import --png --pubkey ~/.gnupg/123213232.pub --in ~/.gnupg/123213232-full.png

Current behavior

/gpg2paper.py import --png --pubkey ~/.gnupg/123213232.pub --in ~/.gnupg/123213232-full.png 
scanned 4 barcode symbols from 1 images in 0.56 seconds

Traceback (most recent call last):
  File "./gpg2paper.py", line 274, in <module>
    sys.exit(main())
  File "./gpg2paper.py", line 109, in main
    do_import(args)
  File "./gpg2paper.py", line 125, in do_import
    return import_from_b64(args.pubkey, base64.b64decode(base64str))
  File "/home/gt01/.virtualenvs/gpg/lib64/python3.7/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

Desired behavior

Key should be imported successfully.

Complete README.md

From a fresh install of Ubuntu 16.10 Yakety Yak, I stumbled upon multiple missing dependencies and problems. I've tried to keep track of every lack in a document. Maybe you should take a look to complete your README.md ๐Ÿ˜‰

Switch to setuptools

Switch from distutils to setuptools to support pip uninstall and make use of requirements.

easy-gpg does not work with python3 and virtualenvs

Steps to reproduce

  1. Clone Repo

  2. Install python3 packages for zbar, qrcode and pillow.

  3. Run Script

./gpg2paper.py 

Current behavior

Traceback (most recent call last):
  File "./gpg2paper.py", line 37, in <module>
    import qrcode

Wanted behavior

./gpg2paper.py 
usage: gpg2paper.py {import,export} ...

import/export gpg key from/to qrcode(s) or base64 string(s)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.