This problem happens because ZBar always tries to convert
the binary data to text. If a character encoding is not specified,
it will try to automatically detect the encoding.

New versions of ZBar will have a binary decoding option.
Users of the zbarimg and zbarcam tools will be able to pass
this option to the QR decoder through the -Sqr.binary option,
or simply -Sbinary. There will also be a new one shot mode.
Passing --raw --oneshot to the ZBar tools will make them decode
exactly one barcode and output nothing but the data contained in it.

With these new features it should be possible to QR encode
secret keys in binary form:

    $   gpg      --export-secret-key $fingerprint    \
      | paperkey --output-type raw                   \
      | qrencode --8bit --output secret-key.qr.png

Using the paperkey tool allows storing even 4096 bit RSA secret keys
in binary QR codes. They can be printed on paper and later restored
with zbarcam:

    $   zbarcam  --raw --oneshot -Sbinary            \
      | paperkey --pubring public-key.asc            \
      | gpg      --import

Reply via email to