Skip to main content

A command line tool to help with key-to-paper and paper-to-key.

Project description

secrets-to-paper

Publish to PyPI

A command-line tool to convert secret keys to printable PDFs and to parse those PDFs back to usable secret keys.

Note: Python 3.8+ is required to use this package. Python 3.8 introduced a new computation for modular inverses.

Changed in version 3.8: For int operands, the three-argument form of pow now allows the second argument to be negative, permitting computation of modular inverses.

Dependencies

Paperkey is a command line tool to export GnuPG keys on paper. It reduces the size of the exported key, by removing the public key parts from the private key. Paperkey also includes CRC-24 checksums in the key to allow the user to check whether their private key has been restored correctly.

  • paperkey (for GPG keys)
  • zbar/libzbar0

Ubuntu/Linux

Add PPA

sudo apt install software-properties-common
sudo add-apt-repository ppa:jaredvacanti/security-dev
sudo apt-get update

# install the package
sudo apt install python3-secrets-to-paper

MacOS X

brew install zbar paperkey

Usage

Usage: stp [OPTIONS] COMMAND [ARGS]...

Options:
  --debug / --no-debug
  --help                Show this message and exit.

Commands:
  export      Helper functions for writing secret keys.
  export-gpg  Helper function to generate archive of GPG keys.
  gen-ecc     Helper function to generate ECC private key from A, B, and D.
  gen-rsa     Helper function to generate RSA private key from P and Q.
  parse       Helper functions to parse secret keys into PEM format.

Development

Initializing a virtual environment:

# requires >= python3.8
pyenv shell 3.8.3

# init & activate virtualenvironment
python -m venv .venv
source .venv/bin/activate

# install poetry in venv, and use to install local package
pip install --upgrade pip
pip install poetry
poetry install

This makes an executable stp available in your $PATH after poetry installations. During development, it's often more convenient to run

poetry run stp ...

instead of re-installing before invocations.

Testing

You can generate a private and public key for testing purposes using openssl.

poetry run tox

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

secrets-to-paper-0.0.5.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

secrets_to_paper-0.0.5-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file secrets-to-paper-0.0.5.tar.gz.

File metadata

  • Download URL: secrets-to-paper-0.0.5.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.7 Linux/5.4.0-1039-azure

File hashes

Hashes for secrets-to-paper-0.0.5.tar.gz
Algorithm Hash digest
SHA256 78efb0b916f3c1836bf2a8a81af05834a14346dd22aa84f0de411ac06068a43f
MD5 f2ae46c883878ad5cae711d1a8e65660
BLAKE2b-256 bad4fcc32ac4c55774cc67926c9c5a70d6e8aba17b6213506ffbbddbe8ec3310

See more details on using hashes here.

File details

Details for the file secrets_to_paper-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: secrets_to_paper-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.7 Linux/5.4.0-1039-azure

File hashes

Hashes for secrets_to_paper-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1fd340b94982999f45d651a6effe54a850b93c26fe86e17c8e63c9320c34fd68
MD5 d5bc1642c44e97316be0eeaa49df3060
BLAKE2b-256 1daa0624d6991fb8c42da0fb602547767a73f8be7cd65a232d8b66d5c782a5e6

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