harrisj/qrencoder

Fails to generate a QRCode for GPG keys

Opened this issue · 2 comments

ralt commented

Hi,

$ gpg --export-secret-key -a "Florian Margaine" | qrencode -o test.png
Failed to encode the input data: Numerical result out of range
$ gpg --export-secret-key -a "Florian Margaine" | wc -c
3594
$ qrencode --version
qrencode version 3.4.2
Copyright (C) 2006-2012 Kentaro Fukuchi

Any idea of where it could come from? I've seen the other issue on libqrencode's repository, but not sure if it's related and if my version includes this library.

I have the same issues

   qrencode -V
   qrencode version 3.9.0
   Copyright (C) 2006-2014 Kentaro Fukuchi

Hi,

qrencode is encoding your private GPG key as 8 bit (binary|utf-8), because the key is not pure alphanumeric. It contains special character. the alphanumeric mode only supports those special character .(%*+-./:).

So the maximum GPG key can only be 2953 char long.

Maybe you could create a QR code from your revoke key. It does not have that many characters. Just for the case of loosing the secret key.