qrencoder icon indicating copy to clipboard operation
qrencoder copied to clipboard

Fails to generate a QRCode for GPG keys

Open ralt opened this issue 11 years ago • 2 comments

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.

ralt avatar Feb 19 '14 09:02 ralt

I have the same issues

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

antenore avatar Feb 27 '14 07:02 antenore

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.

d4ndo avatar Feb 27 '14 10:02 d4ndo