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

sudo apt-get install zbar paperkey

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.4.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

secrets_to_paper-0.0.4-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: secrets-to-paper-0.0.4.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.3 Linux/5.3.0-1031-azure

File hashes

Hashes for secrets-to-paper-0.0.4.tar.gz
Algorithm Hash digest
SHA256 fffcbe9951f0cb94c6e65793fc81fefc4bce303787afcefb8620c3101603ab51
MD5 b79b349d80b626a718027a1ceda06aee
BLAKE2b-256 d5616990e92ac26a070775bd2472b68cf1cf6087a5cb614f9187e458009bf66b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: secrets_to_paper-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.3 Linux/5.3.0-1031-azure

File hashes

Hashes for secrets_to_paper-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3496cd9df2dec59f47cb2cfe9934b3c5da94a254e5c2d6b5e27120159151f088
MD5 21c752c5cca36526831269d30a401dbe
BLAKE2b-256 cfe4bb01aba1779a524cb9fabd2a6aff8e8981b994ce108ab8ca035352f4933e

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