Package: secrets-to-paper
secrets-to-paperA command-line tool to convert secret keys to printable PDFs and to parse those
PDFs back to usable secret keys.Note: Python 3.10+ is required to use this package.
Python 3.8 introduced a new computation formodular 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.Dependenciespaperkeysource/Debian Packagepaperkey 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.zbarsource/Debian Packagefor reading QR codes (2D matrix)USB Scannerhttps://github.com/libusb/hidapiNote: in Linux, USB devices follow a path like this:Kernel:usb coreushbid (a Linux kernel driver)hid subsysteminput subsystemevent devicesUserspace:libinput (a library for handling Linux input devices/dev/input/)libinput Xorg driverXorg or Wayland Compositor driver (which uses the libinput library)mouse drawn on the screenWebcam ImportsYou can also use a webcam with OpenCV to read QR codes.Ubuntu/LinuxAdd PPAsudoaptinstallsoftware-properties-common
sudoadd-apt-repositoryppa:jaredvacanti/security-dev
sudoapt-getupdate# install the packagesudoaptinstallpython3-secrets-to-paperMacOS Xbrewtapjaredvacanti/taps
brewinstallsecrets-to-paperUsageUsage:stp[OPTIONS]COMMAND[ARGS]...

Options:--debug/--no-debug--helpShowthismessageandexit.

Commands:exportHelperfunctionsforwritingsecretkeystopaper.export-gpgHelperfunctionsforwritingGPGkeystopaper.genHelperfunctiontogenerateRSAprivatekeyfromPandQorECCprivatekeyfromA,B,andD.parseHelperfunctionstoparsepaperkeysintousablePEMformat.DevelopmentInitializing a virtual environment# requires >= python3.10pyenvshell3.10# init & activate virtualenvironmentpython-mvenv.venvsource.venv/bin/activate# install poetry in venv, and use to install local packagepipinstall--upgradepip
pipinstallpoetry
poetryinstallThis makes an executablestpavailable in your$PATHafter poetry
installations. During development, it's often more convenient to runpoetryrunstp...instead of re-installing before invocations.Using GPGMEThis is not installed from PyPI.https://github.com/gpg/gpgme/blob/master/lang/python/doc/src/gpgme-python-howto.orgit appears that a copy of the compiled module
may be installed into a virtualenv of the same major and minor version
matching the build. Alternatively it is possible to utilise asites.pthfile in thesite-packages/directory of a virtualenv installation, which
links back to the system installations corresponding directory in order to
import anything installed system wide. This may or may not be appropriate
on a case by case basis.You can link the system installed version into your virtual environment during
development:ln-s/usr/lib/python3/dist-packages/gpg/.venv/lib/python3.10/site-packages/# delete the linkrm-rf.venv/lib/python3.10/site-packages/gpg/Building Debian Packagegitcheckoutdebian/master
gbpbuildpackageTestingYou can generate a private and public key for testing purposes usingopenssl.poetryrunpytest