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) [email protected]:~/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
An async Python library to automate solving ReCAPTCHA v2 by audio using Playwright.

Playwright nonoCAPTCHA An async Python library to automate solving ReCAPTCHA v2 by audio using Playwright. Disclaimer This project is for educational

Michael Mooney 69 Dec 28, 2022
An example which streams RGB-D images over spout.

Spout RGB-D Example An example which streams RGB-D images over spout with visiongraph. Due to the spout dependency this currently only works on Window

Florian Bruggisser 4 Nov 14, 2022
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
Convert the SVG code to PNG and replace the line by a call to the image in markdown

Convert the SVG code to PNG and replace the line by a call to the image in markdown

6 Sep 06, 2022
3D printer / slicing GUI built on top of the Uranium framework

Cura Ultimaker Cura is a state-of-the-art slicer application to prepare your 3D models for printing with a 3D printer. With hundreds of settings and h

Ultimaker 4.4k Jan 02, 2023
Art directed cropping, useful for responsive images

Art direction sets a focal point and can be used when you need multiple copies of the same Image but also in in different proportions.

Daniel 1 Aug 16, 2022
Make your master artistic punk avatar through machine learning world famous paintings

Master-art-punk Make your master artistic punk avatar through machine learning world famous paintings. 通过机器学习世界名画制作属于你的大师级艺术朋克头像 Nowadays, NFT is beco

蒋虎成 23 Jan 04, 2022
a lite weight photo editor written in python for day to day photo editing!

GNU-PhotoShop A lite weight Photo editing Program (currently CLI only) written in python3 for day to day photo editing. Disclaimer : Currently we don'

Kunal Sharma 5 May 30, 2022
Pixel art as well as various sets for hand crafting

Pixel art as well as various sets for hand crafting

1 Nov 09, 2021
A simple programme for converting url into a qr code (.png file)

QrTk A simple lightweight programme for converting url into a qr code (.png file) Pre-Requisites Before installing the programme , you need to run the

Juss Patel 4 Nov 08, 2021
Pythonocc nodes for Ryven

Pythonocc-nodes-for-Ryven Pythonocc nodes for Ryven Here a way to work on Pythonocc with a node editor, Ryven in that case. To get it functional you w

Tanneguy 30 Dec 18, 2022
🎨 Generate and change color-schemes on the fly.

Generate and change color-schemes on the fly. Pywal is a tool that generates a color palette from the dominant colors in an image. It then applies the

dylan 6.9k Jan 03, 2023
Avatar Generator Python

This is a simple avatar generator project which uses your webcam to take pictures and saves five different types of your images into your device including the original image.

Faisal Ahmed 3 Jan 23, 2022
Tool that takes your photo and generates a pixelated color by number photo.

Color by number Tool that takes your photo and generates a pixelated color by number photo. Requirements You need to have python installed on your com

1 Dec 18, 2021
Fast Image Retrieval (FIRe) is an open source image retrieval project

Fast Image Retrieval (FIRe) is an open source image retrieval project release by Center of Image and Signal Processing Lab (CISiP Lab), Universiti Malaya. This project implements most of the major bi

CISiP Lab 39 Nov 25, 2022
A simple Streamlit Component to compare images in Streamlit apps. It integrates Knightlab's JuxtaposeJS

streamlit-image-juxtapose A simple Streamlit Component to compare images in Streamlit apps using Knightlab's JuxtaposeJS. The images are saved to the

Robin 30 Dec 31, 2022
Generate different types of random avatars.

avatar-generator Generate different types of random avatars. Requirements Python3 pytorch=1.6 cv2=3.4 tqdm 1. Github-like avatars python generate_gi

Ming 11 Apr 02, 2022
A proof-of-concept implementation of a parallel-decodable PNG format

mtpng A parallelized PNG encoder in Rust by Brion Vibber [email protected] Backgrou

Brion Vibber 193 Dec 16, 2022
Optimize/Compress images using python

Image Optimization Using Python steps to run the script run the command to install the required libraries pip install -r requirements.txt create a dir

Shekhar Gupta 1 Oct 15, 2021
Magic-Square - Creates a magic square by randomly generating a list until the list happens to be a magic square

Magic-Square Creates a magic square by randomly generating a list until the list happens to be a magic square. Done as simply as possible... Frequentl

Nick 2 Jan 01, 2022