constructive criticism of GPG

Kragen Sitaker kragen@pobox.com
Fri, 2 Mar 2001 20:00:31 -0500 (EST)


GPG's UI is an utter piece of shit.  Here's a transcript from my first
interaction with it:

kragen@tactful:~/public_html/kn/cgi-bin/KN$ gnupg
bash: gnupg: command not found
kragen@tactful:~/public_html/kn/cgi-bin/KN$ gpg
gpg: keyblock resource `/home/kragen/.gnupg': file open error
gpg: keyblock resource `/home/kragen/.gnupg': file open error
gpg: Go ahead and type your message ...
hey?
gpg: no valid OpenPGP data found.
gpg: processing message failed: eof
kragen@tactful:~/public_html/kn/cgi-bin/KN$ gpg --help
gpg (GnuPG) 1.0.4
Copyright (C) 2000 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

Home: ~/.gnupg
Supported algorithms:
Cipher: 3DES, CAST5, BLOWFISH, RIJNDAEL, RIJNDAEL192, RIJNDAEL256, TWOFISH
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA, ELG
Hash: MD5, SHA1, RIPEMD160

Syntax: gpg [options] [files]
sign, check, encrypt or decrypt
default operation depends on the input data

Commands:
 
 -s, --sign [file]                make a signature
     --clearsign [file]           make a clear text signature
 -b, --detach-sign                make a detached signature
 -e, --encrypt                    encrypt data
 -c, --symmetric                  encryption only with symmetric cipher
     --store                      store only
 -d, --decrypt                    decrypt data (default)
     --verify                     verify a signature
     --list-keys                  list keys
     --list-sigs                  list keys and signatures
     --check-sigs                 check key signatures
     --fingerprint                list keys and fingerprints
     --list-secret-keys           list secret keys
     --gen-key                    generate a new key pair
     --delete-key                 remove key from the public keyring
     --delete-secret-key          remove key from the secret keyring
     --sign-key                   sign a key
     --lsign-key                  sign a key locally
     --edit-key                   sign or edit a key
     --gen-revoke                 generate a revocation certificate
     --export                     export keys
     --send-keys                  export keys to a key server
     --recv-keys                  import keys from a key server
     --import                     import/merge keys
     --list-packets               list only the sequence of packets
     --export-ownertrust          export the ownertrust values
     --import-ownertrust          import ownertrust values
     --update-trustdb             update the trust database
     --check-trustdb [NAMES]      check the trust database
     --fix-trustdb                fix a corrupted trust database
     --dearmor                    De-Armor a file or stdin
     --enarmor                    En-Armor a file or stdin
     --print-md algo [files]      print message digests

Options:
 
 -a, --armor                      create ascii armored output
 -r, --recipient NAME             encrypt for NAME
     --default-recipient NAME     use NAME as default recipient
     --default-recipient-self     use the default key as default recipient
 -u, --local-user                 use this user-id to sign or decrypt
 -z N                             set compress level N (0 disables)
     --textmode                   use canonical text mode
 -o, --output                     use as output file
 -v, --verbose                    verbose
 -q, --quiet                      be somewhat more quiet
     --no-tty                     don't use the terminal at all
     --force-v3-sigs              force v3 signatures
     --force-mdc                  always use a MDC for encryption
 -n, --dry-run                    do not make any changes
     --batch                      batch mode: never ask
     --yes                        assume yes on most questions
     --no                         assume no on most questions
     --keyring                    add this keyring to the list of keyrings
     --secret-keyring             add this secret keyring to the list
     --default-key NAME           use NAME as default secret key
     --keyserver HOST             use this keyserver to lookup keys
     --charset NAME               set terminal charset to NAME
     --options                    read options from file
     --status-fd FD               write status info to this FD
     --trusted-key KEYID          ulimately trust this key
     --load-extension FILE        load extension module FILE
     --rfc1991                    emulate the mode described in RFC1991
     --openpgp                    set all packet, cipher and digest options to O
penPGP behavior
     --s2k-mode N                 use passphrase mode N
     --s2k-digest-algo NAME       use message digest algorithm NAME for passphra
ses
     --s2k-cipher-algo NAME       use cipher algorithm NAME for passphrases
     --cipher-algo NAME           use cipher algorithm NAME
     --digest-algo NAME           use message digest algorithm NAME
     --compress-algo N            use compress algorithm N
     --throw-keyid                throw keyid field of encrypted packets
 -N, --notation-data NAME=VALUE   use this notation data

(See the man page for a complete listing of all commands and options)

Examples:

 -se -r Bob [file]          sign and encrypt for user Bob
 --clearsign [file]         make a clear text signature
 --detach-sign [file]       make a detached signature
 --list-keys [names]        show keys
 --fingerprint [names]      show fingerprints

Please report bugs to <gnupg-bugs@gnu.org>.
kragen@tactful:~/public_html/kn/cgi-bin/KN$ gpg --gen-key
gpg (GnuPG) 1.0.4; Copyright (C) 2000 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

gpg: keyblock resource `/home/kragen/.gnupg': file open error
gpg: keyblock resource `/home/kragen/.gnupg': file open error
Please select what kind of key you want:
   (1) DSA and ElGamal (default)
   (2) DSA (sign only)
   (4) ElGamal (sign and encrypt)
Your selection? 1
DSA keypair will have 1024 bits.
About to generate a new ELG-E keypair.
              minimum keysize is  768 bits
              default keysize is 1024 bits
    highest suggested keysize is 2048 bits
What keysize do you want? (1024) 2048
Do you really need such a large keysize? yes, thank you very much.
What keysize do you want? (1024) 2048                             
Do you really need such a large keysize? y
Requested keysize is 2048 bits            
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 6m
Key expires at Wed Aug 29 17:26:08 2001 PDT
Is this correct (y/n)? 
Key is valid for? (0) 6m
Key expires at Wed Aug 29 17:26:23 2001 PDT
Is this correct (y/n)? y
                        
You need a User-ID to identify your key; the software constructs the user id
from Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Real name: Kragen Sitaker (previously Sittler) <kragen@pobox.com>
Invalid character in name                                        
Real name: "Kragen Sitaker (previously Sittler) <kragen@pobox.com>"
Invalid character in name                                          
Real name: Kragen Sitaker                 
Email address: kragen@pobox.com
Comment: previously Sittler    
You selected this USER-ID: 
    "Kragen Sitaker (previously Sittler) <kragen@pobox.com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.    

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
+++++++++++++++.+++++.+++++.++++++++++.++++++++++++++++++++++++++++++.++++++++++.+++++++++++++++.++++++++++++++++++++.++++++++++++++++++++.+++++>+++++..............>+++++...............................<.+++++..>+++++........<+++++...................>.+++++...............+++++

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 298 more bytes)
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
+++++.++++++++++++++++++++..+++++.++++++++++++++++++++.+++++.++++++++++++++++++++..+++++++++++++++++++++++++++++++++++.++++++++++++++++++++..+++++.++++++++++>.+++++.+++++>+++++..........+++++^^^
gpg: keyblock resource `/home/kragen/.gnupg': file open error
gpg: can add keyblock file `/home/kragen/.gnupg/pubring.gpg'
Key generation failed: file create error
gpg: can't create `/home/kragen/.gnupg/random_seed': No such file or directory
kragen@tactful:~/public_html/kn/cgi-bin/KN$ 

Note the following problems --- nearly all trivial to fix, but having
significant impact on users of the software, demonstrating an
impressive level of unconcern for the software's users:
1. gpg's default action is apparently to encrypt a message, rather than to
   explain how to use it.
2. gpg fails to get the key information it would need to encrypt the message,
   but prompts for the message anyway.
3. user input doesn't use readline, even though I have readline
   installed and every other GPLed Debian program I use (including ftp)
   uses readline.  This means, among other things, that my backspace key
   doesn't work.
4. "Do you really need such a large keysize?" is a stupid question.  It
   might have some merit if it explained why nobody actually needs such
   a large keysize before asking the question.
5. "Do you really need such a large keysize?" interprets "yes" to mean
   "no", but doesn't explain that it is doing so.
6. "Requested keysize is 2048 bits" is a stupid piece of output.  I
   *know* what fucking keysize I just requested, thankyouverymuch, and
   if I didn't, it would be too late for me to change my mind.
7. "key does not expire" is the default expiry time.
8. "Is this correct (y/n)?" interprets the empty string to mean "no",
   but doesn't explain that it is doing so.
9. I have to answer three separate prompts to construct my user id.
10. The example user id given is not a valid input to the program.
11. "Invalid character in name" doesn't explain that the problem is
    that I entered a user ID when I needed to enter only my name.
12. "Invalid character in name" doesn't explain which character is invalid.
13. "Passphrase" is capitalized.
14. "We need to generate a lot of random bytes" and the ensuing
    paragraph appears twice.
15. "Need 298 more bytes" gave me no indication of the progress of
    gathering more random bytes, so I had no way to guess how much
    longer it would take.  This was frustrating.
16. After I did all this work to generate my key, GNUPG discarded it
    because, apparently because there was no .gnupg directory.  This is
    a condition which (a) GNUPG was aware of when the program started
    (because it printed error messages about it) and (b) is not
    erroneous --- it simply indicates that I have not used GNUPG on
    this account in the past.

#16 is the most serious of all of these stupid bugs.

I'm only bothering to send this email because I think GNUPG is
important and I trust that either the GNUPG maintainers or the FSF
cares enough to improve the quality of GNUPG if they know what's wrong
with it.  I know it's easy to become so myopic you can't see the most
obvious, harmful, and trivial bugs in your own software; I've done it
myself.  I hope this serves as a wake-up call.

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we possess
ourselves.
       -- Gandalf the White [J.R.R. Tolkien, "The Two Towers", Bk 3, Ch. XI]