A previous instance of gpg has most likely exited abnormally and left
a lock file. Go to ~/.gnupg and look for .*.lock files and remove them.
<Q> Older gpg binaries (e.g., 1.0) have problems with keys from newer
gpg binaries ...
As of 1.0.3, keys generated with gpg are created with preferences to
TWOFISH (and AES since 1.0.4) and that also means that they have the
capability to use the new MDC encryption method. This will go into
OpenPGP soon, and is also suppoted by PGP 7. This new method avoids
a (not so new) attack on all email encryption systems.
This in turn means that pre-1.0.3 gpg binaries have problems with
newer keys. Because of security and bug fixes, you should keep your
GnuPG installation in a recent state anyway. As a workaround, you can
force gpg to use a previous default cipher algo by putting:
[H samp]
cipher-algo cast5
[H /samp]
into your options file.
<Q> With 1.0.4, I get "this cipher algorithm is deprecated ..."
If you just generated a new key and get this message while
encrypting, you've witnessed a bug in 1.0.4. It uses the new AES
cipher Rijndael that is incorrectly being referred as "deprecated".
Ignore this warning, more recent versions of gpg are corrected.
<Q> Some dates are displayed as ????-??-??. Why?
Due to constraints in most libc implementations, dates beyond
2038-01-19 can't be displayed correctly. 64-bit OSes are not
affected by this problem. To avoid printing wrong dates, GnuPG
instead prints some question marks. To see the correct value, you
can use the options --with-colons and --fixed-list-mode.
<Q> I still have a problem. How do I report a bug?
Are you sure that it's not been mentioned somewhere on the mailing
lists? Did you have a look at the bug list (you'll find a link to
the list of reported bugs on the documentation page). If you're not
sure about it being a bug, you can send mail to the gnupg-devel
list. Otherwise, use the GUUG bug tracking system
[H a href=http://bugs.guug.de/Reporting.html]<http://bugs.guug.de/Reporting.html>[H /a].
<Q> Why doesn't GnuPG support X.509 certificates?
GnuPG, first and foremost, is an implementation of the OpenPGP
standard (RFC 2440), which is a competing infrastructure, different
from X.509.
They are both public-key cryptosystems, but how the public keys are
actually handled is different.
<Q> Why do national characters in my user ID look funny?
According to OpenPGP, GnuPG encodes user ID strings (and other
things) using UTF-8. In this encoding of Unicode, most national
characters get encoded as two- or three-byte sequences. For
example, å (0xE5 in ISO-8859-1) becomes Ã¥ (0xC3,
0xA5). This might also be the reason why keyservers can't find
your key.
<Q> I get 'sed' errors when running ./configure on Mac OS X ...
This will be fixed after GnuPG has been upgraded to autoconf-2.50.
Until then, find the line setting CDPATH in the configure script
and place an:
[H samp]
unset CDPATH
[H /samp]
statement below it.
<Q> Why does GnuPG 1.0.6 bail out on keyrings used with 1.0.7?
There is a small bug in 1.0.6 which didn't parse trust packets
correctly. You may want to apply this patch if you can't upgrade:
[H a href=http://www.gnupg.org/developer/gpg-woody-fix.txt]<http://www.gnupg.org/developer/gpg-woody-fix.txt>[H /a]
<Q> I upgraded to GnuPG version 1.0.7 and now it takes longer to load my
keyrings. What can I do?
The way signature states are stored has changed so that v3 signatures
can be supported. You can use the new --rebuild-keydb-caches migration
command, which was built into this release and increases the speed of
many operations for existing keyrings.
<Q> Doesn't a fully trusted user ID on a key prevent warning messages
when encrypting to other IDs on the key?
No. That was actually a key validity bug in GnuPG 1.2.1 and earlier
versions. As part of the development of GnuPG 1.2.2, a bug was
discovered in the key validation code. This bug causes keys with
more than one user ID to give all user IDs on the key the amount of
validity given to the most-valid key. The bug has been fixed in GnuPG
release 1.2.2, and upgrading is the recommended fix for this problem.
More information and a patch for a some pre-1.2.2 versions of GnuPG
can be found at:
[H a href=http://lists.gnupg.org/pipermail/gnupg-announce/2003q2/000268.html]<http://lists.gnupg.org/pipermail/gnupg-announce/2003q2/000268.html>[H /a]
<Q> I just compiled GnuPG from source on my GNU/Linux RPM-based system
and it's not working. Why?
Many GNU/Linux distributions that are RPM-based will install a
version of GnuPG as part of its standard installation, placing the
binaries in the /usr/bin directory. Later, compiling and installing
GnuPG from source other than from a source RPM won't normally
overwrite these files, as the default location for placement of
GnuPG binaries is in /usr/local/bin unless the '--prefix' switch
is used during compile to specify an alternate location. Since the
/usr/bin directory more than likely appears in your path before
/usr/local/bin, the older RPM-version binaries will continue to
be used when called since they were not replaced.
To resolve this, uninstall the RPM-based version with 'rpm -e gnupg'
before installing the binaries compiled from source. If dependency
errors are displayed when attempting to uninstall the RPM (such as
when Red Hat's up2date is also installed, which uses GnuPG), uninstall
the RPM with 'rpm -e gnupg --nodeps' to force the uninstall. Any
dependent files should be automatically replaced during the install
of the compiled version. If the default /usr/local/bin directory is
used, some packages such as SuSE's Yast Online Update may need to be
configured to look for GnuPG binaries in the /usr/local/bin directory,
or symlinks can be created in /usr/bin that point to the binaries
located in /usr/local/bin.
<S> ADVANCED TOPICS
<Q> How does this whole thing work?
To generate a secret/public keypair, run:
[H samp]
$ gpg --gen-key
[H /samp]
and choose the default values.
Data that is encrypted with a public key can only be decrypted by
the matching secret key. The secret key is protected by a password,
the public key is not.
So to send your friend a message, you would encrypt your message
with his public key, and he would only be able to decrypt it by
having the secret key and putting in the password to use his secret
key.
GnuPG is also useful for signing things. Files that are encrypted
with the secret key can be decrypted with the public key. To sign
something, a hash is taken of the data, and then the hash is in some
form encoded with the secret key. If someone has your public key, they
can verify that it is from you and that it hasn't changed by checking
the encoded form of the hash with the public key.
A keyring is just a large file that stores keys. You have a public
keyring where you store yours and your friend's public keys. You have
a secret keyring that you keep your secret key on, and should be very
careful with. Never ever give anyone else access to it and use a *good*
passphrase to protect the data in it.
You can 'conventionally' encrypt something by using the option 'gpg -c'.
It is encrypted using a passphrase, and does not use public and secret
keys. If the person you send the data to knows that passphrase, they
can decrypt it. This is usually most useful for encrypting things to
yourself, although you can encrypt things to your own public key in the
same way. It should be used for communication with partners you know
and where it is easy to exchange the passphrases (e.g. with your boy
friend or your wife). The advantage is that you can change the
passphrase from time to time and decrease the risk, that many old
messages may be decrypted by people who accidently got your passphrase.
You can add and copy keys to and from your keyring with the 'gpg
--import' and 'gpg --export' command. 'gpg --export-secret-keys' will
export secret keys. This is normally not useful, but you can generate
the key on one machine then move it to another machine.
Keys can be signed under the 'gpg --edit-key' option. When you sign a
key, you are saying that you are certain that the key belongs to the
person it says it comes from. You should be very sure that is really
that person: You should verify the key fingerprint with:
[H samp]
$ gpg --fingerprint KeyID
[H /samp]
over the phone (if you really know the voice of the other person), at
a key signing party (which are often held at computer conferences),
or at a meeting of your local GNU/Linux User Group.
Hmm, what else. You may use the option '-o filename' to force output
to this filename (use '-' to force output to stdout). '-r' just lets
you specify the recipient (which public key you encrypt with) on the
command line instead of typing it interactively.
Oh yeah, this is important. By default all data is encrypted in some
weird binary format. If you want to have things appear in ASCII text
that is readable, just add the '-a' option. But the preferred method
is to use a MIME aware mail reader (Mutt, Pine and many more).
There is a small security glitch in the OpenPGP (and therefore GnuPG)
system; to avoid this you should always sign and encrypt a message
instead of only encrypting it.
<Q> Why are some signatures with an ELG-E key valid?
These are Elgamal keys generated by GnuPG in v3 (RFC 1991) packets.
The OpenPGP draft later changed the algorithm identifier for Elgamal
keys which are usable for signatures and encryption from 16 to 20.
GnuPG now uses 20 when it generates new Elgamal keys but still
accepts 16 (which is according to OpenPGP "encryption only") if this
key is in a v3 packet. GnuPG is the only program which had used
these v3 Elgamal keys - so this assumption is quite safe.
<Q> How does the whole trust thing work?
It works more or less like PGP. The difference is that the trust is
computed at the time it is needed. This is one of the reasons for
the trustdb which holds a list of valid key signatures. If you are
not running in batch mode you will be asked to assign a trust
parameter (ownertrust) to a key.
You can see the validity (calculated trust value) using this
command.
[H samp]
$ gpg --list-keys --with-colons
[H /samp]
If the first field is "pub" or "uid", the second field shows you the
trust:
[H pre]
o = Unknown (this key is new to the system)
e = The key has expired
q = Undefined (no value assigned)
n = Don't trust this key at all
m = There is marginal trust in this key
f = The key is full trusted
u = The key is ultimately trusted; this is only used
for keys for which the secret key is also available.
r = The key has been revoked
d = The key has been disabled
[H /pre]
The value in the "pub" record is the best one of all "uid" records.
You can get a list of the assigned trust values (how much you trust
the owner to correctly sign another person's key) with:
[H samp]
$ gpg --list-ownertrust
[H /samp]
The first field is the fingerprint of the primary key, the second
field is the assigned value:
[H pre]
- = No ownertrust value yet assigned or calculated.
n = Never trust this keyholder to correctly verify others signatures.
m = Have marginal trust in the keyholders capability to sign other
keys.
f = Assume that the key holder really knows how to sign keys.
u = No need to trust ourself because we have the secret key.
[H /pre]
Keep these values confidential because they express your opinions
about others. PGP stores this information with the keyring thus it
is not a good idea to publish a PGP keyring instead of exporting the
keyring. GnuPG stores the trust in the trustdb.gpg file so it is okay
to give a gpg keyring away (but we have a --export command too).
<Q> What kind of output is this: "key C26EE891.298, uid 09FB: ...."?
This is the internal representation of a user ID in the trustdb.
"C26EE891" is the keyid, "298" is the local ID (a record number in
the trustdb) and "09FB" is the last two bytes of a ripe-md-160 hash
of the user ID for this key.
<Q> How do I interpret some of the informational outputs?
While checking the validity of a key, GnuPG sometimes prints some
information which is prefixed with information about the checked
item.
[H samp]
"key 12345678.3456"
[H /samp]
This is about the key with key ID 12345678 and the internal number
3456, which is the record number of the so called directory record
in the trustdb.
[H samp]
"uid 12345678.3456/ACDE"
[H /samp]
This is about the user ID for the same key. To identify the user ID
the last two bytes of a ripe-md-160 over the user ID ring is printed.
[H samp]
"sig 12345678.3456/ACDE/9A8B7C6D"
[H /samp]
This is about the signature with key ID 9A8B7C6D for the above key
and user ID, if it is a signature which is direct on a key, the user
ID part is empty (..//..).
<Q> Are the header lines of a cleartext signature part of the signed
material?
No. For example you can add or remove "Comment:" lines. They have
a purpose like the mail header lines. However a "Hash:" line is
needed for OpenPGP signatures to tell the parser which hash
algorithm to use.
<Q> What is the list of preferred algorithms?
The list of preferred algorithms is a list of cipher, hash and
compression algorithms stored in the self-signature of a key during
key generation. When you encrypt a document, GnuPG uses this list
(which is then part of a public key) to determine which algorithms
to use. Basically it tells other people what algorithms the
recipient is able to handle and provides an order of preference.
<Q> How do I change the list of preferred algorithms?
In version 1.0.7 or later, you can use the edit menu and set the
new list of preference using the command "setpref"; the format of
this command resembles the output of the command "pref". The
preference is not changed immediately but the set preference will
be used when a new user ID is created. If you want to update the
preferences for existing user IDs, select those user IDs (or select
none to update all) and enter the command "updpref". Note that the
timestamp of the self-signature is increased by one second when
running this command.
<S> ACKNOWLEDGEMENTS
Many thanks to Nils Ellmenreich for maintaining this FAQ file for
such a long time, Werner Koch for the original FAQ file, and to all
posters to gnupg-users and gnupg-devel. They all provided most of
the answers.
Also thanks to Casper Dik for providing us with a script to generate
this FAQ (he uses it for the excellent Solaris2 FAQ).