Paper backup of files using QR codes

Overview

Generate paper backups for Linux. Currently command-linux Linux only.

Takes any file, and outputs a "paper backup": a printable black-and-white pdf full of QR codes. To back up your file, print the PDF. The pile of paper in your hand is now a backup of the file.

This is alpha software--I use it for my own backups, but I offer no guarantees. Test your restore when you make it, not when you need it!

What is a paper backup?

A paper backup is a number of printed sheets of paper containing special barcodes.

If your file is lost, corrupted, deleted, etc, you can restore from your paper backup. qr-backup reads the QR barcodes using your computer's webcam (or scanner) to get your file back.

Should I back up to paper?

Possibly. You should still back it up to something more usual like a USB thumbstick first, because it's easier to restore and update.

Common files to back up are small important records, and small secret files. Examples include: a diary, an address book, a short story you wrote, financial records, medical records, an ssh or gpg cryptographic key, or a cryptocurrency (bitcoin) wallet.

Paper is not the best or most efficient storage method, so you can't back up big files. 10KB or 100KB files is a reasonable limit.

Learn about the advantages of paper backups.

Example Backup

Example Backup

System Requirements

Backup Requirements

  • A Linux computer and knowledge of how to use the command line
  • A printer
  • python 3.6 or later
  • python-qrcode
  • python-pillow
  • imagemagick
  • zbar (optional, used to digitally test restore)

Restore Requirements

  • A Linux computer and knowledge of how to use the command line
  • The restore process works without qr-backup installed
  • A webcam or scanner
  • imagemagick
  • zbar

Making a backup

  1. Run qr-backup on your file. On the Linux command-line, run qr-backup
  2. This generates a black-and-white PDF (.qr.pdf)
  3. Print the PDF on your printer

There are many command-line options available for advanced users. For a full list, read the USAGE doc online, or run qr-backup --help on your computer.

Restoring a paper backup

The restore process does NOT require qr-backup. It does require a command-linux Linux computer.

(Option 1): Use qr-backup, if you have it.

  • Webcam option
    1. Run qr-backup --restore
  • Scanner option
    1. Scan images using your scanner
    2. Run qr-backup --restore IMAGES

(Option 2): Use the linux command line, if you lose qr-backup. Commands are provided in the PDF printout. You will need to install zbar.

More questions

For more questions, see the FAQ.

Comments
  • Investigate par2 format for parity

    Investigate par2 format for parity

    I've been working on this on my own implementation.

    There's an easy solution that already exists. Par2 is a recovery file which generates Reed Solomon codes. It's a packetized format, so you can zero pad each packet to fit in a QR code and the programs will still read them.

    The downside is that you need to be aware that recovery packets are 64 bytes larger compared to the recovery block size.

    If you don't care about exact alignment, you can just use Par2 as is. If you do, I am currently working on Par2Py, which will allow for alignment and for using an optional packet type that stores the data itself inside the Par2 file itself.

    The advantage of this approach is if you do one Par2 packet per QR code, then not only can you recover from some codes missing, but you can also recover from codes being scrambled!

    Originally posted by @EmperorArthur in https://github.com/za3k/qr-backup/issues/2#issuecomment-890360305

    enhancement question 
    opened by za3k 19
  • (meta) Adjusting the settings to obtain a higher storage density

    (meta) Adjusting the settings to obtain a higher storage density

    I wanted to open this issue as a more open-ended alternative to the pull request I made (#25). I definitely think that a higher storage density (on paper) can be achieved than the defaults currently provide, which would save paper and storage space.

    Version 40 does not appear to work to any reasonable degress when printed. However, after doing some experimentation, I have found that QR version 25 with error correction level "H" can be used to fit a 4x3 grid of codes onto a page which, when printed, can be scanned reliably by both my phone (which is a mid-range Android from 2018) and a scanner, and can reliably reproduce a valid backup without any issue.

    Please give it a try and let me know what you think.

    enhancement 
    opened by arcanemachine 10
  • Add option to print human-readable information to stdout

    Add option to print human-readable information to stdout

    This is just a small modification that enables the QR code data to be printed to stdout by using the --human-readable-stdout flag, so that it can, for example, be piped to a text file and printed off.

    It's not pretty, but it easily and effectively adds an important layer of redundancy. In case 1 or more QR codes becomes corrupted, the data can still be recovered by manual entry.

    The flag itself was chosen so that it doesn't collide with a more well-integrated --human-readable flag that would presumably be added to the document using Pillow.

    opened by arcanemachine 9
  • Allow restore with some QR codes missing or damaged (parity)

    Allow restore with some QR codes missing or damaged (parity)

    This would essentially require qr-backup --restore... there's no easy command-line programs to do this. Try to make it restorable without qr-backup if there's no damage.

    Edit: could also support shamir's secret sharing scheme

    enhancement help wanted 
    opened by za3k 7
  • Webcam restore blocks CLI prompts

    Webcam restore blocks CLI prompts

    Screenshot of the problem is requested--author uses a tiling window manager and didn't think about this.

    Do people find the preview useful? It can just be turned off entirely.

    enhancement good first issue 
    opened by za3k 4
  • All versions of Pillow > 8.2.0 create a PDF that doesn't work in most PDF readers I tried.

    All versions of Pillow > 8.2.0 create a PDF that doesn't work in most PDF readers I tried.

    EDIT: Using Pillow 8.2.0 generates uncorrupted PDFs.

    Hello, this program is generating broken PDFs that do not display in any PDF view that I have tried, with the exception of Chrome.

    In Linux, the PDF fails to open in Evince, Firefox, and Libreoffice Draw (this one crashes).

    On Adroid, the PDF works in an old Google PDF reader app that I use, but fails in Moon Reader.

    In all apps that display the PDF without crashing, the PDF looks the same: like a noisy, streaky mess.

    I am using Xubuntu 21.04 x64.

    I have tried a couple different files with the same result. To show my issues, I have attempted to create a backup of CHANGELOG from the latest commit (currently 926355d85ddd3fb8878da07e5cf464d47fb14569).

    Here is a link to the PDF generated: https://filelink.org/kRWFohOf6Lur0RZ Here is an image of how it looks on my computer (on anything other than Chromium) and on Android Moon Reader: https://ibb.co/6J9XGJC

    Here are the versions I have installed (via pip freeze from a venv):

    Pillow==9.0.1
    qrcode==7.3.1
    

    Here is my terminal output from when I created the file:

    (venv) user@host:~/code/git/qr-backup$ ./qr-backup CHANGELOG -v
    INFO:root:Original arguments were: []
    INFO:root:Command arguments parsed. Equivalent command: qr-backup --qr-version 10 --dpi 300 --scale 8 --error-correction L --page 500 600 --compress --filename CHANGELOG
    INFO:root:read file CHANGELOG (sha b8d63ca5584ffa66aea55851e6fb9f60b5a10542086a95cfba2b5cd6479870a4, 2.731KB)
    INFO:root:Restore command is: sort -u | grep "^N" | cut -c6- | base64 -d | gunzip
    INFO:root:9 qr codes (at version 10) total
    INFO:root:QR code (including label) is: 520x520px
    INFO:root:Page is: 2083x2500px
    INFO:root:4 x 4 qr codes (at version 10) per page. 1 pages total
    INFO:root:1326 bytes in 1 (2.73KB/page)
    WARNING:root:Skipping digital restore verification, because zbarimg is not available.
    
    bug 
    opened by arcanemachine 3
  • Use QR version 40 to increase amount of data per page

    Use QR version 40 to increase amount of data per page

    The default QR code version used (version 10) results in the creation of many QR codes. This requires many more scans (and thus, much more effort) than the the highest-density QR code version 40. Furthermore, version 40 codes have higher information density over a given area that version 10, meaning their usage will save both time and paper.

    Therefore, this simple pull request is to change the default QR code version from 10 to 40.

    opened by arcanemachine 2
  • Add `--human-readable` mode

    Add `--human-readable` mode

    Add a human-readable mode, in which the original file is printed along with the QR codes (the same data on the page should match the data in the QR codes). One row of QR codes per page max seems reasonable.

    enhancement 
    opened by za3k 2
  • base64 encoding always turned on

    base64 encoding always turned on

    In the FAQ, it says: "Make sure your document doesn't contain weird characters (including "\r", the mac/windows newline), or base64 encoding will turn on, which makes recovery harder."

    However, it seems there's no conditional use of base64 encoding in the code, and alpha strings are always encoded:

    $ echo -n ipsum > ipsum.txt
    $ qr-backup --no-compress -o ipsum.pdf ipsum.txt
    $ zbarimg ipsum.pdf 
    QR-Code:N1/1 aXBzdW0=
    scanned 1 barcode symbols from 1 images in 0,04 seconds
    
    documentation 
    opened by misaki-web 1
  • Add a 'text-backup' tool

    Add a 'text-backup' tool

    Add a separate command line tool text-backup which generates a text-mode backup instead of using QR. It should be keyed back in by hand.

    Ideas:

    • Include checksums and ECC per-line
    • Can we make it "readable" if the original is text, so that you don't have to key in some text to read other text?
    • Try to make it easy to type? BIP39 wordlist, PGP word list, etc may be a good option but then need the wordlist to decode.
    • Generate .txt by default with a .pdf option

    This will require factoring out the "QR" backup, restore, and test process from the rest of the logic. Could be done before or after adding erasure coding.

    enhancement good first issue 
    opened by za3k 1
  • Add erasure coding. This allows losing some QR codes

    Add erasure coding. This allows losing some QR codes

    IMPORTANT: This doesn't work currently. There seems to be a bug in the reedsolo library. It has been reported at https://github.com/tomerfiliba/reedsolomon/issues/34

    This required removing the proprocessing step of base64 encoding. Instead, we base64 encode each QR code independently (always). Sadly this does make the data a little less readable while debugging. Closes #2.

    opened by za3k 1
  • Webcam restore -- unshuffle

    Webcam restore -- unshuffle

    During webcam restore, missing codes are listed as "N1", "N2" etc.

    It might be reasonable to un-shuffle using prng and hint at position?

    enhancement 
    opened by za3k 0
  • Roadmap

    Roadmap

    • [x] v1.0: Initial release
    • [x] v1.1: Feature complete
    • [ ] release: Ship in any easy-to-install format
    • [ ] v1.2: Support for Windows, Mac, and Android. Add GUI.
    documentation 
    opened by za3k 1
  • Make page layout look better

    Make page layout look better

    Currently, the argument --page allows to set the width and the height (--page 500 600), but the page margins can't be specified. For example, cover instructions basically don't have any margin:

    default margin

    It would be useful to be able to set horizontal and vertical margins like this:

    --page WIDTH_POINTS+HOR_MARGIN_POINTS HEIGHT_POINTS+VER_MARGIN_POINTS
    

    Example:

    --page 500+15 600+15
    

    more margin

    It would also allow to center the QR codes on the page.

    enhancement 
    opened by misaki-web 2
Releases(v1.1.3)
  • v1.1.3(Oct 15, 2022)

    Generate paper backups for Linux. Currently command-line Linux only.

    qr-backup takes file(s), and outputs a "paper backup": a printable black-and-white pdf full of QR codes. To back up your file, print the PDF. The pile of paper in your hand is now a backup of the file.

    If your file is lost, corrupted, deleted, etc, you can restore from your paper backup. qr-backup reads the QR barcodes using your computer's webcam (or scanner) to get your file back.


    Major new features:

    v1.1.3

    • bash completion
    • add experimental debian package build scripts to Makefile

    v1.1.2

    • qr-backup is ready for packaging

    v1.1

    • Add --restore option, which automatically does a restore in qr-backup itself. Previously restore was done with a bash oneliner only (which still works). Note that --restore cannot restore backups made with v1.0.
    • An automatic digital restore check is done after every backup.
    • Allow restore (using qr-backup only) even if up to 30% of barcodes are missing. Uses reed-solomon erasure codes.
    • Improved data density, but this roughly cancels out with increased size from erasure coding.
    • Optional password protection (encryption).
    • Support backing up a directory. Support backing up multiple files or directories
    • Support printing multiple copies of each barcode
    • Customize printed documentation (less, more, custom notes)

    View CHANGELOG for all details.

    Source code(tar.gz)
    Source code(zip)
    qr-backup-1.1.3.tar.gz(470.45 KB)
    qr-backup-1.1.3.tar.gz.sig(833 bytes)
    qr-backup_1.1.3-1_all.deb(31.82 KB)
  • v1.1.2(Sep 30, 2022)

    Generate paper backups for Linux. Currently command-line Linux only.

    qr-backup takes file(s), and outputs a "paper backup": a printable black-and-white pdf full of QR codes. To back up your file, print the PDF. The pile of paper in your hand is now a backup of the file.

    If your file is lost, corrupted, deleted, etc, you can restore from your paper backup. qr-backup reads the QR barcodes using your computer's webcam (or scanner) to get your file back.


    Major new features:

    v1.1.2

    • qr-backup is ready for packaging

    v1.1

    • Add --restore option, which automatically does a restore in qr-backup itself. Previously restore was done with a bash oneliner only (which still works). Note that --restore cannot restore backups made with v1.0.
    • An automatic digital restore check is done after every backup.
    • Allow restore (using qr-backup only) even if up to 30% of barcodes are missing. Uses reed-solomon erasure codes.
    • Improved data density, but this roughly cancels out with increased size from erasure coding.
    • Optional password protection (encryption).
    • Support backing up a directory. Support backing up multiple files or directories
    • Support printing multiple copies of each barcode
    • Customize printed documentation (less, more, custom notes)

    View CHANGELOG for all details.

    Source code(tar.gz)
    Source code(zip)
  • v1.0(Jun 1, 2021)

Owner
Zachary Vance
Zachary Vance
This will help to read QR codes using Raspberry Pi and Pi Camera

Raspberry-Pi-Generate-and-Read-QR-code This will help to read QR codes using Raspberry Pi and Pi Camera Install the required libraries first in your T

Raspberry_Pi Pakistan 2 Nov 6, 2021
View images in the terminal using ansi escape codes and python

terminal-photo-viewer view images in the terminal using ansi escape codes and python !! Only tested on Ubuntu 20.04.3 LTS with python version 3.8.10 D

null 1 Nov 30, 2021
Design custom QR codes with this web app!

My-QR.Art This web app lets users design their own QR codes to any domain. It can be acessed on my-qr.art. You can find some more background info abou

Marien Raat 406 Dec 20, 2022
DP2 graph edit codes.

必要なソフト・パッケージ Python3 Numpy JSON Matplotlib 動作確認環境 MacBook Air M1 Python 3.8.2 (arm64) Numpy 1.22.0 Matplotlib 3.5.1 JSON 2.0.9 使い方 draw_time_histgram(

null 1 Feb 19, 2022
QR code python application which can read(decode) and generate(encode) QR codes.

QR Code Application This is a basic QR Code application. Using this application you can generate QR code for you text/links. Using this application yo

Atharva Parkhe 1 Aug 9, 2022
Viewer for NFO files

NFO Viewer NFO Viewer is a simple viewer for NFO files, which are "ASCII" art in the CP437 codepage. The advantages of using NFO Viewer instead of a t

Osmo Salomaa 114 Dec 29, 2022
An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C.

vizh An esoteric visual language that takes image files as input based on a multi-tape turing machine, designed for compatibility with C. Overview Her

Sy Brand 228 Dec 17, 2022
Easy to use Python module to extract Exif metadata from digital image files.

Easy to use Python module to extract Exif metadata from digital image files.

ianaré sévi 719 Jan 5, 2023
HTML2Image is a lightweight Python package that acts as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.

A package acting as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.

null 176 Jan 1, 2023
Repair broken bookmarks to referenced files in Apple Photos

Repair Apple Photos Bookmarks Work in progress to repair file location bookmarks in Apple Photos. Background Starting in macOS 10.15/Catalina, photos

Rhet Turnbull 10 Nov 3, 2022
Small wrapper around 3dmol.js and html2canvas for creating self-contained HTML files that display a 3D molecular representation.

Description Small wrapper around 3dmol.js and html2canvas for creating self-contained HTML files that display a 3D molecular representation. Double cl

David Meijer 1 Dec 2, 2021
A minimal, standalone viewer for 3D animations stored as stop-motion sequences of individual .obj mesh files.

ObjSequenceViewer V0.5 A minimal, standalone viewer for 3D animations stored as stop-motion sequences of individual .obj mesh files. Installation: pip

csmailis 2 Aug 4, 2022
Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

null 1 Jan 16, 2022
3D Model files and source code for rotating turntable. Raspberry Pi, DC servo and PWM modulator required.

3DSimpleTurntable 3D Model files and source code for rotating turntable. Raspberry Pi, DC servo and PWM modulator required. Preview Construction Print

Thomas Boyle 1 Feb 13, 2022
python binding for libvips using cffi

README PyPI package: https://pypi.python.org/pypi/pyvips conda package: https://anaconda.org/conda-forge/pyvips We have formatted docs online here: ht

libvips 467 Dec 30, 2022
pix2tex: Using a ViT to convert images of equations into LaTeX code.

The goal of this project is to create a learning based system that takes an image of a math formula and returns corresponding LaTeX code.

Lukas Blecher 2.6k Dec 30, 2022
Multi-view 3D reconstruction using neural rendering. Unofficial implementation of UNISURF, VolSDF, NeuS and more.

Multi-view 3D reconstruction using neural rendering. Unofficial implementation of UNISURF, VolSDF, NeuS and more.

Jianfei Guo 683 Jan 4, 2023
Unique image & metadata generation using weighted layer collections.

nft-generator-py nft-generator-py is a python based NFT generator which programatically generates unique images using weighted layer files. The progra

Jonathan Becker 243 Dec 31, 2022