2
<title>GnuPG FAQ</title>
5
<body bgcolor=#ffffff text=#000000 link=#1f00ff alink=#ff0000 vlink=#9900dd>
6
<h1>GnuPG Frequently Asked Questions</h1>
11
Last-Modified: Jul 30, 2003<br>
12
Maintained-by: David D. Scribner, <faq 'at' gnupg.org>
16
This is the GnuPG FAQ. The latest HTML version is available
17
<a href=http://www.gnupg.org/documentation/faqs.html>here</a>.
19
The index is generated automatically, so there may be errors. Not all
20
questions may be in the section they belong to. Suggestions about how
21
to improve the structure of this FAQ are welcome.
23
Please send additions and corrections to the maintainer. It would be
24
most convenient if you could provide the answer to be included here
25
as well. Your help is very much appreciated!
27
Please, don't send message like "This should be a FAQ - what's the
28
answer?". If it hasn't been asked before, it isn't a FAQ. In that case
29
you could search in the mailing list archive.
33
<h2><A HREF=#q1>1. GENERAL
35
<LI><a HREF=#q1.1>1.1) What is GnuPG?
37
<LI><a HREF=#q1.2>1.2) Is GnuPG compatible with PGP?
39
<LI><a HREF=#q1.3>1.3) Is GnuPG free to use for personal or commercial use?
41
<LI><a HREF=#q1.4>1.4) What conventions are used in this FAQ?
43
<h2><A HREF=#q2>2. SOURCES of INFORMATION
45
<LI><a HREF=#q2.1>2.1) Where can I find more information on GnuPG?
47
<LI><a HREF=#q2.2>2.2) Where do I get GnuPG?
49
<h2><A HREF=#q3>3. INSTALLATION
51
<LI><a HREF=#q3.1>3.1) Which OSes does GnuPG run on?
53
<LI><a HREF=#q3.2>3.2) Which random data gatherer should I use?
55
<LI><a HREF=#q3.3>3.3) How do I include support for RSA and IDEA?
57
<h2><A HREF=#q4>4. USAGE
59
<LI><a HREF=#q4.1>4.1) What is the recommended key size?
61
<LI><a HREF=#q4.2>4.2) Why does it sometimes take so long to create keys?
63
<LI><a HREF=#q4.3>4.3) And it really takes long when I work on a remote system. Why?
65
<LI><a HREF=#q4.4>4.4) What is the difference between options and commands?
67
<LI><a HREF=#q4.5>4.5) I can't delete a user ID on my secret keyring because it has
68
already been deleted on my public keyring. What can I do?
70
<LI><a HREF=#q4.6>4.6) I can't delete my secret key because the public key disappeared.
73
<LI><a HREF=#q4.7>4.7) What are trust, validity and ownertrust?
75
<LI><a HREF=#q4.8>4.8) How do I sign a patch file?
77
<LI><a HREF=#q4.9>4.9) Where is the "encrypt-to-self" option?
79
<LI><a HREF=#q4.10>4.10) How can I get rid of the Version and Comment headers in armored
82
<LI><a HREF=#q4.11>4.11) What does the "You are using the xxxx character set." mean?
84
<LI><a HREF=#q4.12>4.12) How can I get list of key IDs used to encrypt a message?
86
<LI><a HREF=#q4.13>4.13) Why can't I decrypt files encrypted as symmetrical-only (-c) with
87
a version of GnuPG prior to 1.0.1.
89
<LI><a HREF=#q4.14>4.14) How can I use GnuPG in an automated environment?
91
<LI><a HREF=#q4.15>4.15) Which email-client can I use with GnuPG?
93
<LI><a HREF=#q4.16>4.16) Can't we have a gpg library?
95
<LI><a HREF=#q4.17>4.17) I have successfully generated a revocation certificate, but I don't
96
understand how to send it to the key servers.
98
<LI><a HREF=#q4.18>4.18) How do I put my keyring in a different directory?
100
<LI><a HREF=#q4.19>4.19) How do I verify signed packages?
102
<LI><a HREF=#q4.20>4.20) How do I export a keyring with only selected signatures (keys)?
104
<LI><a HREF=#q4.21>4.21) I still have my secret key, but lost my public key. What can I do?
106
<LI><a HREF=#q4.22>4.22) Clearsigned messages sent from my web-mail account have an invalid
109
<h2><A HREF=#q5>5. COMPATIBILITY ISSUES
111
<LI><a HREF=#q5.1>5.1) How can I encrypt a message with GnuPG so that PGP is able to decrypt it?
113
<LI><a HREF=#q5.2>5.2) How do I migrate from PGP 2.x to GnuPG?
115
<LI><a HREF=#q5.3>5.3) (removed)
117
<LI><a HREF=#q5.4>5.4) Why is PGP 5.x not able to encrypt messages with some keys?
119
<LI><a HREF=#q5.5>5.5) Why is PGP 5.x not able to verify my messages?
121
<LI><a HREF=#q5.6>5.6) How do I transfer owner trust values from PGP to GnuPG?
123
<LI><a HREF=#q5.7>5.7) PGP does not like my secret key.
125
<LI><a HREF=#q5.8>5.8) GnuPG no longer installs a ~/.gnupg/options file. Is it missing?
127
<LI><a HREF=#q5.9>5.9) How do you export GnuPG keys for use with PGP?
129
<h2><A HREF=#q6>6. PROBLEMS and ERROR MESSAGES
131
<LI><a HREF=#q6.1>6.1) Why do I get "gpg: Warning: using insecure memory!"
133
<LI><a HREF=#q6.2>6.2) Large File Support doesn't work ...
135
<LI><a HREF=#q6.3>6.3) In the edit menu the trust values are not displayed correctly after
138
<LI><a HREF=#q6.4>6.4) What does "skipping pubkey 1: already loaded" mean?
140
<LI><a HREF=#q6.5>6.5) GnuPG 1.0.4 doesn't create ~/.gnupg ...
142
<LI><a HREF=#q6.6>6.6) An Elgamal signature does not verify anymore since version 1.0.2 ...
144
<LI><a HREF=#q6.7>6.7) Old versions of GnuPG can't verify Elgamal signatures
146
<LI><a HREF=#q6.8>6.8) When I use --clearsign, the plain text has sometimes extra dashes
149
<LI><a HREF=#q6.9>6.9) What is the thing with "can't handle multiple signatures"?
151
<LI><a HREF=#q6.10>6.10) If I submit a key to a keyserver, nothing happens ...
153
<LI><a HREF=#q6.11>6.11) I get "gpg: waiting for lock ..."
155
<LI><a HREF=#q6.12>6.12) Older gpg binaries (e.g., 1.0) have problems with keys from newer
158
<LI><a HREF=#q6.13>6.13) With 1.0.4, I get "this cipher algorithm is deprecated ..."
160
<LI><a HREF=#q6.14>6.14) Some dates are displayed as ????-??-??. Why?
162
<LI><a HREF=#q6.15>6.15) I still have a problem. How do I report a bug?
164
<LI><a HREF=#q6.16>6.16) Why doesn't GnuPG support X.509 certificates?
166
<LI><a HREF=#q6.17>6.17) Why do national characters in my user ID look funny?
168
<LI><a HREF=#q6.18>6.18) I get 'sed' errors when running ./configure on Mac OS X ...
170
<LI><a HREF=#q6.19>6.19) Why does GnuPG 1.0.6 bail out on keyrings used with 1.0.7?
172
<LI><a HREF=#q6.20>6.20) I upgraded to GnuPG version 1.0.7 and now it takes longer to load my
173
keyrings. What can I do?
175
<LI><a HREF=#q6.21>6.21) Doesn't a fully trusted user ID on a key prevent warning messages
176
when encrypting to other IDs on the key?
178
<LI><a HREF=#q6.22>6.22) I just compiled GnuPG from source on my GNU/Linux RPM-based system
179
and it's not working. Why?
181
<h2><A HREF=#q7>7. ADVANCED TOPICS
183
<LI><a HREF=#q7.1>7.1) How does this whole thing work?
185
<LI><a HREF=#q7.2>7.2) Why are some signatures with an ELG-E key valid?
187
<LI><a HREF=#q7.3>7.3) How does the whole trust thing work?
189
<LI><a HREF=#q7.4>7.4) What kind of output is this: "key C26EE891.298, uid 09FB: ...."?
191
<LI><a HREF=#q7.5>7.5) How do I interpret some of the informational outputs?
193
<LI><a HREF=#q7.6>7.6) Are the header lines of a cleartext signature part of the signed
196
<LI><a HREF=#q7.7>7.7) What is the list of preferred algorithms?
198
<LI><a HREF=#q7.8>7.8) How do I change the list of preferred algorithms?
200
<LI><a HREF=#q7.9>7.9) How can I import all the missing signer keys?
202
<h2><A HREF=#q8>8. ACKNOWLEDGEMENTS
209
<A NAME=q1>1. GENERAL
213
<a NAME=q1.1>1.1)</a> What is GnuPG?
216
<a href=http://www.gnupg.org>GnuPG</a> stands for GNU Privacy Guard and
217
is GNU's tool for secure communication and data storage. It can be
218
used to encrypt data and to create digital signatures. It includes
219
an advanced key management facility and is compliant with the
220
proposed OpenPGP Internet standard as described in <a href=http://www.rfc-editor.org/>RFC 2440</a>.
221
As such, it is aimed to be compatible with PGP from PGP Corp. and
225
<a NAME=q1.2>1.2)</a> Is GnuPG compatible with PGP?
228
In general, yes. GnuPG and newer PGP releases should be implementing
229
the OpenPGP standard. But there are some interoperability problems.
230
See question <a HREF=#q5.1>5.1</a> for details.
233
<a NAME=q1.3>1.3)</a> Is GnuPG free to use for personal or commercial use?
236
Yes. GnuPG is part of the GNU family of tools and applications built
237
and provided in accordance with the Free Software Foundation (FSF)
238
General Public License (GPL). Therefore the software is free to copy,
239
use, modify and distribute in accordance with that license. Please
240
read the file titled COPYING that accompanies the application for
244
<a NAME=q1.4>1.4)</a> What conventions are used in this FAQ?
247
Although GnuPG is being developed for several operating systems
248
(often in parallel), the conventions used in this FAQ reflect a
249
UNIX shell environment. For Win32 users, references to a shell
250
prompt (`$') should be interpreted as a command prompt (`>'),
251
directory names separated by a forward slash (`/') may need to be
252
converted to a back slash (`\'), and a tilde (`~') represents a
253
user's "home" directory (reference question <a HREF=#q4.18>4.18</a> for an example).
255
Some command-lines presented in this FAQ are too long to properly
256
display in some browsers for the web page version of this file, and
257
have been split into two or more lines. For these commands please
258
remember to enter the entire command-string on one line or the
259
command will error, or at minimum not give the desired results.
261
Please keep in mind that this FAQ contains information that may not
262
apply to your particular version, as new features and bug fixes are
263
added on a continuing basis (reference the NEWS file included with
264
the source or package for noteworthy changes between versions). One
265
item to note is that starting with GnuPG version 1.1.92 the file
266
containing user options and settings has been renamed from "options"
267
to "gpg.conf". Information in the FAQ that relates to the options
268
file may be interchangable with the newer gpg.conf file in many
269
instances. See question <a HREF=#q5.8>5.8</a> for details.
273
<A NAME=q2>2. SOURCES of INFORMATION
277
<a NAME=q2.1>2.1)</a> Where can I find more information on GnuPG?
283
<li>The documentation page is located at <a href=http://www.gnupg.org/documentation/><http://www.gnupg.org/documentation/></a>.
284
Also, have a look at the HOWTOs and the GNU Privacy Handbook (GPH,
285
available in English, Spanish and Russian). The latter provides a
286
detailed user's guide to GnuPG. You'll also find a document about how
287
to convert from PGP 2.x to GnuPG.
289
<li>At <a href=http://www.gnupg.org/documentation/mailing-lists.html><http://www.gnupg.org/documentation/mailing-lists.html></a> you'll find
290
an online archive of the GnuPG mailing lists. Most interesting should
291
be gnupg-users for all user-related issues and gnupg-devel if you want
292
to get in touch with the developers.
294
In addition, searchable archives can be found on MARC, e.g.: <br>
295
gnupg-users: <a href=http://marc.theaimsgroup.com/?l=gnupg-users&r=1&w=2><http://marc.theaimsgroup.com/?l=gnupg-users&r=1&w=2></a><br>
296
gnupg-devel: <a href=http://marc.theaimsgroup.com/?l=gnupg-devel&r=1&w=2><http://marc.theaimsgroup.com/?l=gnupg-devel&r=1&w=2></a><br>
299
Before posting to a list, read this FAQ and the available documentation.
300
In addition, search the list archive - maybe your question has already
301
been discussed. This way you help people focus on topics that have not
304
<li>The GnuPG source distribution contains a subdirectory:
310
where some additional documentation is located (mainly interesting
311
for hackers, not the casual user).
315
<a NAME=q2.2>2.2)</a> Where do I get GnuPG?
318
You can download the GNU Privacy Guard from its primary FTP server
319
<a href=ftp://ftp.gnupg.org/gcrypt/><ftp://ftp.gnupg.org/gcrypt/></a> or from one of the mirrors:
321
<a href=http://www.gnupg.org/download/mirrors.html>
322
<http://www.gnupg.org/download/mirrors.html>
325
The current stable version is 1.2.2. Please upgrade to this version as
326
it includes additional features, functions and security fixes that may
327
not have existed in prior versions.
331
<A NAME=q3>3. INSTALLATION
335
<a NAME=q3.1>3.1)</a> Which OSes does GnuPG run on?
338
It should run on most Unices as well as Windows versions (including
339
Windows NT/2000) and Macintosh OS/X. A list of OSes reported to be OK
342
<a href=http://www.gnupg.org/download/supported_systems.html>
343
<http://www.gnupg.org/download/supported_systems.html>
347
<a NAME=q3.2>3.2)</a> Which random data gatherer should I use?
350
"Good" random numbers are crucial for the security of your encryption.
351
Different operating systems provide a variety of more or less quality
352
random data. Linux and *BSD provide kernel generated random data
353
through /dev/random - this should be the preferred choice on these
354
systems. Also Solaris users with the SUNWski package installed have
355
a /dev/random. In these cases, use the configure option:
358
--enable-static-rnd=linux
361
In addition, there's also the kernel random device by Andi Maier
362
<a href= http://www.cosy.sbg.ac.at/~andi/SUNrand/><http://www.cosy.sbg.ac.at/~andi/SUNrand/></a>, but it's still beta. Use at your
365
On other systems, the Entropy Gathering Daemon (EGD) is a good choice.
366
It is a perl-daemon that monitors system activity and hashes it into
367
random data. See the download page <a href=http://www.gnupg.org/download/><http://www.gnupg.org/download/></a>
371
--enable-static-rnd=egd
376
If the above options do not work, you can use the random number
377
generator "unix". This is <B>very</B> slow and should be avoided. The
378
random quality isn't very good so don't use it on sensitive data.
381
<a NAME=q3.3>3.3)</a> How do I include support for RSA and IDEA?
384
RSA is included as of GnuPG version 1.0.3.
386
The official GnuPG distribution does not contain IDEA due to a patent
387
restriction. The patent does not expire before 2007 so don't expect
388
official support before then.
390
However, there is an unofficial module to include it even in earlier
391
versions of GnuPG. It's available from
392
<a href=ftp://ftp.gnupg.dk/pub/contrib-dk/><ftp://ftp.gnupg.dk/pub/contrib-dk/></a>. Look for:
396
idea.c.gz.sig (signature file)
400
ideadll.zip (c module and win32 dll)
401
ideadll.zip.sig (signature file)
404
Compilation directives are in the headers of these files. You will
405
then need to add the following line to your ~/.gnupg/gpg.conf or
406
~/.gnupg/options file:
418
<a NAME=q4.1>4.1)</a> What is the recommended key size?
421
1024 bit for DSA signatures; even for plain Elgamal signatures.
422
This is sufficient as the size of the hash is probably the weakest
423
link if the key size is larger than 1024 bits. Encryption keys may
424
have greater sizes, but you should then check the fingerprint of
428
$ gpg --fingerprint <user ID>
431
As for the key algorithms, you should stick with the default (i.e.,
432
DSA signature and Elgamal encryption). An Elgamal signing key has
433
the following disadvantages: the signature is larger, it is hard
434
to create such a key useful for signatures which can withstand some
435
real world attacks, you don't get any extra security compared to
436
DSA, and there might be compatibility problems with certain PGP
437
versions. It has only been introduced because at the time it was
438
not clear whether there was a patent on DSA.
441
<a NAME=q4.2>4.2)</a> Why does it sometimes take so long to create keys?
444
The problem here is that we need a lot of random bytes and for that
445
we (on Linux the /dev/random device) must collect some random data.
446
It is really not easy to fill the Linux internal entropy buffer; I
447
talked to Ted Ts'o and he commented that the best way to fill the
448
buffer is to play with your keyboard. Good security has its price.
449
What I do is to hit several times on the shift, control, alternate,
450
and caps lock keys, because these keys do not produce output to the
451
screen. This way you get your keys really fast (it's the same thing
454
Another problem might be another program which eats up your random
455
bytes (a program (look at your daemons) that reads from /dev/random).
458
<a NAME=q4.3>4.3)</a> And it really takes long when I work on a remote system. Why?
461
Don't do this at all! You should never create keys or even use GnuPG
462
on a remote system because you normally have no physical control
463
over your secret key ring (which is in most cases vulnerable to
464
advanced dictionary attacks) - I strongly encourage everyone to only
465
create keys on a local computer (a disconnected laptop is probably
466
the best choice) and if you need it on your connected box (I know,
467
we all do this) be sure to have a strong password for both your
468
account and for your secret key, and that you can trust your system
471
When I check GnuPG on a remote system via ssh (I have no Alpha here)
472
;-) I have the same problem. It takes a *very* long time to create
473
the keys, so I use a special option, --quick-random, to generate
474
insecure keys which are only good for some tests.
477
<a NAME=q4.4>4.4)</a> What is the difference between options and commands?
480
If you do a 'gpg --help', you will get two separate lists. The first
481
is a list of commands. The second is a list of options. Whenever you
482
run GPG, you <b>must</b> pick exactly one command (with one exception,
483
see below). You <b>may</b> pick one or more options. The command should,
484
just by convention, come at the end of the argument list, after all
485
the options. If the command takes a file (all the basic ones do),
486
the filename comes at the very end. So the basic way to run gpg is:
489
$ gpg [--option something] [--option2] [--option3 something] --command file
492
Some options take arguments. For example, the --output option (which
493
can be abbreviated as -o) is an option that takes a filename. The
494
option's argument must follow immediately after the option itself,
495
otherwise gpg doesn't know which option the argument is supposed to
496
paired with. As an option, --output and its filename must come before
497
the command. The --recipient (-r) option takes a name or keyID to
498
encrypt the message to, which must come right after the -r option.
499
The --encrypt (or -e) command comes after all the options and is
500
followed by the file you wish to encrypt. Therefore in this example
501
the command-line issued would be:
504
$ gpg -r alice -o secret.txt -e test.txt
507
If you write the options out in full, it is easier to read:
510
$ gpg --recipient alice --output secret.txt --encrypt test.txt
513
If you're encrypting to a file with the extension ".txt", then you'd
514
probably expect to see ASCII-armored text in the file (not binary),
515
so you need to add the --armor (-a) option, which doesn't take any
519
$ gpg --armor --recipient alice --output secret.txt --encrypt test.txt
522
If you imagine square brackets around the optional parts, it becomes
526
$ gpg [--armor] [--recipient alice] [--output secret.txt] --encrypt test.txt
529
The optional parts can be rearranged any way you want:
532
$ gpg --output secret.txt --recipient alice --armor --encrypt test.txt
535
If your filename begins with a hyphen (e.g. "-a.txt"), GnuPG assumes
536
this is an option and may complain. To avoid this you have to either
537
use "./-a.txt", or stop the option and command processing with two
538
hyphens: "-- -a.txt".
540
<B>The exception to using only one command:</B> signing and encrypting
541
at the same time. For this you can combine both commands, such as in:
544
$ gpg [--options] --sign --encrypt foo.txt
548
<a NAME=q4.5>4.5)</a> I can't delete a user ID on my secret keyring because it has
549
already been deleted on my public keyring. What can I do?
552
Because you can only select from the public key ring, there is no
553
direct way to do this. However it is not very complicated to do
554
anyway. Create a new user ID with exactly the same name and you
555
will see that there are now two identical user IDs on the secret
556
ring. Now select this user ID and delete it. Both user IDs will be
557
removed from the secret ring.
560
<a NAME=q4.6>4.6)</a> I can't delete my secret key because the public key disappeared.
564
To select a key a search is always done on the public keyring,
565
therefore it is not possible to select a secret key without
566
having the public key. Normally it should never happen that the
567
public key got lost but the secret key is still available. The
568
reality is different, so GnuPG implements a special way to deal
569
with it: Simply use the long keyID to specify the key to delete,
570
which can be obtained by using the --with-colons options (it is
571
the fifth field in the lines beginning with "sec").
573
If you've lost your public key and need to recreate it instead
574
for continued use with your secret key, you may be able to use
575
gpgsplit as detailed in question <a HREF=#q4.21>4.21</a>.
578
<a NAME=q4.7>4.7)</a> What are trust, validity and ownertrust?
581
With GnuPG, the term "ownertrust" is used instead of "trust" to
582
help clarify that this is the value you have assigned to a key
583
to express how much you trust the owner of this key to correctly
584
sign (and thereby introduce) other keys. The "validity", or
585
calculated trust, is a value which indicates how much GnuPG
586
considers a key as being valid (that it really belongs to the
587
one who claims to be the owner of the key). For more information
588
on trust values see the chapter "The Web of Trust" in The GNU
592
<a NAME=q4.8>4.8)</a> How do I sign a patch file?
595
Use "gpg --clearsign --not-dash-escaped ...". The problem with
596
--clearsign is that all lines starting with a dash are quoted with
597
"- "; obviously diff produces many lines starting with a dash and
598
these are then quoted and that is not good for a patch ;-). To use
599
a patch file without removing the cleartext signature, the special
600
option --not-dash-escaped may be used to suppress generation of
601
these escape sequences. You should not mail such a patch because
602
spaces and line endings are also subject to the signature and a
603
mailer may not preserve these. If you want to mail a file you can
604
simply sign it using your MUA (Mail User Agent).
607
<a NAME=q4.9>4.9)</a> Where is the "encrypt-to-self" option?
610
Use "--encrypt-to your_keyID". You can use more than one of these
611
options. To temporarily override the use of this additional key,
612
you can use the option "--no-encrypt-to".
615
<a NAME=q4.10>4.10)</a> How can I get rid of the Version and Comment headers in armored
619
Use "--no-version --comment ''". Note that the left over blank line
620
is required by the protocol.
623
<a NAME=q4.11>4.11)</a> What does the "You are using the xxxx character set." mean?
626
This note is printed when UTF-8 mapping has to be done. Make sure
627
that the displayed character set is the one you have activated on
628
your system. Since "iso-8859-1" is the character set most used,
629
this is the default. You can change the charset with the option
630
"--charset". It is important that your active character set matches
631
the one displayed - if not, restrict yourself to plain 7 bit ASCII
632
and no mapping has to be done.
635
<a NAME=q4.12>4.12)</a> How can I get list of key IDs used to encrypt a message?
639
$ gpg --batch --decrypt --list-only --status-fd 1 2>/dev/null |
640
awk '/^\[GNUPG:\] ENC_TO / { print $3 }'
644
<a NAME=q4.13>4.13)</a> Why can't I decrypt files encrypted as symmetrical-only (-c) with
645
a version of GnuPG prior to 1.0.1.
648
There was a bug in GnuPG versions prior to 1.0.1 which affected files
649
only if 3DES or Twofish was used for symmetric-only encryption (this has
650
never been the default). The bug has been fixed, but to enable decryption
651
of old files you should run gpg with the option "--emulate-3des-s2k-bug",
652
decrypt the file and encrypt it again without this option.
654
NOTE: This option was removed in GnuPG development version 1.1.0 and later
655
updates, so you will need to use a version between 1.0.1 and 1.0.7 to
656
re-encrypt any affected files.
659
<a NAME=q4.14>4.14)</a> How can I use GnuPG in an automated environment?
662
You should use the option --batch and don't use passphrases as
663
there is usually no way to store it more securely than on the
664
secret keyring itself. The suggested way to create keys for an
665
automated environment is:
669
<li> If you want to do automatic signing, create a signing subkey
670
for your key (use the interactive key editing menu by issueing
671
the command 'gpg --edit-key keyID', enter "addkey" and select
673
<li> Make sure that you use a passphrase (needed by the current
675
<li> gpg --export-secret-subkeys --no-comment foo >secring.auto
676
<li> Copy secring.auto and the public keyring to a test directory.
677
<li> Change to this directory.
678
<li> gpg --homedir . --edit foo and use "passwd" to remove the
679
passphrase from the subkeys. You may also want to remove all
681
<li> Copy secring.auto to a floppy and carry it to the target box.
684
On the target machine:
686
<li> Install secring.auto as the secret keyring.
687
<li> Now you can start your new service. It's also a good idea to
688
install an intrusion detection system so that you hopefully
689
get a notice of an successful intrusion, so that you in turn
690
can revoke all the subkeys installed on that machine and
695
<a NAME=q4.15>4.15)</a> Which email-client can I use with GnuPG?
698
Using GnuPG to encrypt email is one of the most popular uses.
699
Several mail clients or mail user agents (MUAs) support GnuPG to
700
varying degrees. Simplifying a bit, there are two ways mail can be
701
encrypted with GnuPG: the "old style" ASCII armor (i.e. cleartext
702
encryption), and RFC 2015 style (previously PGP/MIME, now OpenPGP).
703
The latter has full MIME support. Some MUAs support only one of
704
them, so whichever you actually use depends on your needs as well
705
as the capabilities of your addressee. As well, support may be
706
native to the MUA, or provided via "plug-ins" or external tools.
708
The following list is not exhaustive:
711
MUA OpenPGP ASCII How? (N,P,T)
712
-------------------------------------------------------------
713
Calypso N Y P (Unixmail)
714
Elm N Y T (mailpgp,morepgp)
716
Emacs/Gnus Y Y T (Mailcrypt,gpg.el)
718
Emacs/VM N Y T (Mailcrypt)
721
GNUMail.app Y Y P (PGPBundle)
723
KMail (<=1.4.x) N Y N
724
KMail (1.5.x) Y(P) Y(N) P/N
725
Mozilla Y Y P (Enigmail)
731
XEmacs/Gnus Y Y T (Mailcrypt)
733
XEmacs/VM N Y T (Mailcrypt)
736
N - Native, P - Plug-in, T - External Tool
739
The following table lists proprietary MUAs. The GNU Project
740
suggests against the use of these programs, but they are listed
741
for interoperability reasons for your convenience.
744
MUA OpenPGP ASCII How? (N,P,T)
745
-------------------------------------------------------------
746
Apple Mail Y Y P (GPGMail)
747
Becky2 Y Y P (BkGnuPG)
748
Eudora Y Y P (EuroraGPG)
749
Eudora Pro Y Y P (EudoraGPG)
752
Netscape 7.x Y Y P (Enigmail)
753
Novell Groupwise N Y P
754
Outlook N Y P (G-Data)
755
Outlook Express N Y P (GPGOE)
756
Pegasus N Y P (QDPGP,PM-PGP)
757
Pine N Y T (pgpenvelope,(gpg|pgp)4pine)
758
Postme N Y P (GPGPPL)
759
The Bat! N Y P (Ritlabs)
762
Good overviews of OpenPGP-support can be found at:<br>
763
<a href=http://www.openpgp.fr.st/courrier_en.html><http://www.openpgp.fr.st/courrier_en.html></a> and<br>
764
<a href=http://www.bretschneidernet.de/tips/secmua.html><http://www.bretschneidernet.de/tips/secmua.html></a>.
766
Users of Win32 MUAs that lack OpenPGP support may look into
767
using GPGrelay <a href=http://gpgrelay.sourceforge.net><http://gpgrelay.sourceforge.net></a>, a small
768
email-relaying server that uses GnuPG to enable many email clients
769
to send and receive emails that conform to PGP-MIME (RFC 2015).
772
<a NAME=q4.16>4.16)</a> Can't we have a gpg library?
775
This has been frequently requested. However, the current viewpoint
776
of the GnuPG maintainers is that this would lead to several security
777
issues and will therefore not be implemented in the foreseeable
778
future. However, for some areas of application gpgme could do the
779
trick. You'll find it at <a href=ftp://ftp.gnupg.org/gcrypt/alpha/gpgme><ftp://ftp.gnupg.org/gcrypt/alpha/gpgme></a>.
782
<a NAME=q4.17>4.17)</a> I have successfully generated a revocation certificate, but I don't
783
understand how to send it to the key servers.
786
Most keyservers don't accept a 'bare' revocation certificate. You
787
have to import the certificate into gpg first:
790
$ gpg --import my-revocation.asc
793
then send the revoked key to the keyservers:
796
$ gpg --keyserver certserver.pgp.com --send-keys mykeyid
799
(or use a keyserver web interface for this).
802
<a NAME=q4.18>4.18)</a> How do I put my keyring in a different directory?
805
GnuPG keeps several files in a special homedir directory. These
806
include the options file, pubring.gpg, secring.gpg, trustdb.gpg,
807
and others. GnuPG will always create and use these files. On unices,
808
the homedir is usually ~/.gnupg; on Windows it is name "gnupg" and
809
found below the user's application directory. Run the gpg and
810
pass the option --version to see the name of that directory.
812
If you want to put your keyrings somewhere else, use the option:
818
to make GnuPG create all its files in that directory. Your keyring
819
will be "/my/path/pubring.gpg". This way you can store your secrets
820
on a floppy disk. Don't use "--keyring" as its purpose is to specify
821
additional keyring files.
824
<a NAME=q4.19>4.19)</a> How do I verify signed packages?
827
Before you can verify the signature that accompanies a package,
828
you must first have the vendor, organisation, or issueing person's
829
key imported into your public keyring. To prevent GnuPG warning
830
messages the key should also be validated (or locally signed).
832
You will also need to download the detached signature file along
833
with the package. These files will usually have the same name as
834
the package, with either a binary (.sig) or ASCII armor (.asc)
837
Once their key has been imported, and the package and accompanying
838
signature files have been downloaded, use:
841
$ gpg --verify sigfile signed-file
844
If the signature file has the same base name as the package file,
845
the package can also be verified by specifying just the signature
846
file, as GnuPG will derive the package's file name from the name
847
given (less the .sig or .asc extension). For example, to verify a
848
package named foobar.tar.gz against its detached binary signature
852
$ gpg --verify foobar.tar.gz.sig
856
<a NAME=q4.20>4.20)</a> How do I export a keyring with only selected signatures (keys)?
859
If you're wanting to create a keyring with only a subset of keys
860
selected from a master keyring (for a club, user group, or company
861
department for example), simply specify the keys you want to export:
864
$ gpg --armor --export key1 key2 key3 key4 > keys1-4.asc
868
<a NAME=q4.21>4.21)</a> I still have my secret key, but lost my public key. What can I do?
871
All OpenPGP secret keys have a copy of the public key inside them,
872
and in a worst-case scenario, you can create yourself a new public
873
key using the secret key.
875
A tool to convert a secret key into a public one has been included
876
(it's actually a new option for gpgsplit) and is available with GnuPG
877
versions 1.2.1 or later (or can be found in CVS). It works like this:
880
$ gpgsplit --no-split --secret-to-public secret.gpg >publickey.gpg
883
One should first try to export the secret key and convert just this
884
one. Using the entire secret keyring should work too. After this has
885
been done, the publickey.gpg file can be imported into GnuPG as usual.
888
<a NAME=q4.22>4.22)</a> Clearsigned messages sent from my web-mail account have an invalid
892
Check to make sure the settings for your web-based email account
893
do not use HTML formatting for the pasted clearsigned message. This can
894
alter the message with embedded HTML markup tags or spaces, resulting
895
in an invalid signature. The recipient may be able to copy the signed
896
message block to a text file for verification, or the web email
897
service may allow you to attach the clearsigned message as a file
898
if plaintext messages are not an option.
902
<A NAME=q5>5. COMPATIBILITY ISSUES
906
<a NAME=q5.1>5.1)</a> How can I encrypt a message with GnuPG so that PGP is able to decrypt it?
909
It depends on the PGP version.
913
You can't do that because PGP 2.x normally uses IDEA which is not
914
supported by GnuPG as it is patented (see <a HREF=#q3.3>3.3</a>), but if you have a
915
modified version of PGP you can try this:
918
$ gpg --rfc1991 --cipher-algo 3des ...
921
Please don't pipe the data to encrypt to gpg but provide it using a
922
filename; otherwise, PGP 2 will not be able to handle it.
924
As for conventional encryption, you can't do this for PGP 2.
926
<li>PGP 5.x and higher<br>
927
You need to provide two additional options:
930
--compress-algo 1 --cipher-algo cast5
933
You may also use "3des" instead of "cast5", and "blowfish" does not
934
work with all versions of PGP 5. You may also want to put:
940
into your ~/.gnupg/options file - this does not affect normal GnuPG
943
This applies to conventional encryption as well.
947
<a NAME=q5.2>5.2)</a> How do I migrate from PGP 2.x to GnuPG?
950
PGP 2 uses the RSA and IDEA encryption algorithms. Whereas the RSA
951
patent has expired and RSA is included as of GnuPG 1.0.3, the IDEA
952
algorithm is still patented until 2007. Under certain conditions you
953
may use IDEA even today. In that case, you may refer to Question
954
<a HREF=#q3.3>3.3</a> about how to add IDEA support to GnuPG and read
955
<a href=http://www.gnupg.org/gph/en/pgp2x.html><http://www.gnupg.org/gph/en/pgp2x.html></a> to perform the migration.
958
<a NAME=q5.3>5.3)</a> (removed)
964
<a NAME=q5.4>5.4)</a> Why is PGP 5.x not able to encrypt messages with some keys?
967
PGP, Inc. refuses to accept Elgamal keys of type 20 even for
968
encryption. They only support type 16 (which is identical at least
969
for decryption). To be more inter-operable, GnuPG (starting with
970
version 0.3.3) now also uses type 16 for the Elgamal subkey which is
971
created if the default key algorithm is chosen. You may add a type
972
16 Elgamal key to your public key, which is easy as your key
973
signatures are still valid.
976
<a NAME=q5.5>5.5)</a> Why is PGP 5.x not able to verify my messages?
979
PGP 5.x does not accept v4 signatures for data material but OpenPGP
980
requests generation of v4 signatures for all kind of data, that's why
981
GnuPG defaults to them. Use the option "--force-v3-sigs" to generate
982
v3 signatures for data.
985
<a NAME=q5.6>5.6)</a> How do I transfer owner trust values from PGP to GnuPG?
988
There is a script in the tools directory to help you. After you have
989
imported the PGP keyring you can give this command:
992
$ lspgpot pgpkeyring | gpg --import-ownertrust
995
where pgpkeyring is the original keyring and not the GnuPG keyring
996
you might have created in the first step.
999
<a NAME=q5.7>5.7)</a> PGP does not like my secret key.
1002
Older PGPs probably bail out on some private comment packets used by
1003
GnuPG. These packets are fully in compliance with OpenPGP; however
1004
PGP is not really OpenPGP aware. A workaround is to export the
1005
secret keys with this command:
1008
$ gpg --export-secret-keys --no-comment -a your-KeyID
1011
Another possibility is this: by default, GnuPG encrypts your secret
1012
key using the Blowfish symmetric algorithm. Older PGPs will only
1013
understand 3DES, CAST5, or IDEA symmetric algorithms. Using the
1014
following method you can re-encrypt your secret gpg key with a
1018
$ gpg --s2k-cipher-algo=CAST5 --s2k-digest-algo=SHA1
1019
--compress-algo=1 --edit-key <username>
1022
Then use passwd to change the password (just change it to the same
1023
thing, but it will encrypt the key with CAST5 this time).
1025
Now you can export it and PGP should be able to handle it.
1027
For PGP 6.x the following options work to export a key:
1030
$ gpg --s2k-cipher-algo 3des --compress-algo 1 --rfc1991
1031
--export-secret-keys <KeyID>
1035
<a NAME=q5.8>5.8)</a> GnuPG no longer installs a ~/.gnupg/options file. Is it missing?
1038
No. The ~/.gnupg/options file has been renamed to ~/.gnupg/gpg.conf for
1039
new installs as of version 1.1.92. If an existing ~/.gnupg/options file
1040
is found during an upgrade it will still be used, but this change was
1041
required to have a more consistent naming scheme with forthcoming tools.
1042
An existing options file can be renamed to gpg.conf for users upgrading,
1043
or receiving the message that the "old default options file" is ignored
1044
(occurs if both a gpg.conf and an options file are found).
1047
<a NAME=q5.9>5.9)</a> How do you export GnuPG keys for use with PGP?
1050
This has come up fairly often, so here's the HOWTO:
1052
PGP can (for most key types) use secret keys generated by GnuPG. The
1053
problems that come up occasionally are generally because GnuPG
1054
supports a few more features from the OpenPGP standard than PGP does.
1055
If your secret key has any of those features in use, then PGP will
1056
reject the key or you will have problems communicating later. Note
1057
that PGP doesn't do Elgamal signing keys at all, so they are not
1058
usable with any version.
1060
These instructions should work for GnuPG 1.0.7 and later, and PGP
1063
Start by editing the key. Most of this line is not really necessary
1064
as the default values are correct, but it does not hurt to repeat the
1065
values, as this will override them in case you have something else set
1066
in your options file.
1069
$ gpg --s2k-cipher-algo cast5 --s2k-digest-algo sha1 --s2k-mode 3
1070
--simple-sk-checksum --edit KeyID
1073
Turn off some features. Set the list of preferred ciphers, hashes,
1074
and compression algorithms to things that PGP can handle. (Yes, I
1075
know this is an odd list of ciphers, but this is what PGP itself uses,
1079
> setpref S9 S8 S7 S3 S2 S10 H2 H3 Z1 Z0
1082
Now put the list of preferences onto the key.
1088
Finally we must decrypt and re-encrypt the key, making sure that we
1089
encrypt with a cipher that PGP likes. We set this up in the --edit
1090
line above, so now we just need to change the passphrase to make it
1091
take effect. You can use the same passphrase if you like, or take
1092
this opportunity to actually change it.
1104
Now we can do the usual export:
1107
$ gpg --export KeyID > mypublickey.pgp<br>
1108
$ gpg --export-secret-key KeyID > mysecretkey.pgp
1111
Thanks to David Shaw for this information!
1115
<A NAME=q6>6. PROBLEMS and ERROR MESSAGES
1119
<a NAME=q6.1>6.1)</a> Why do I get "gpg: Warning: using insecure memory!"
1122
On many systems this program should be installed as setuid(root).
1123
This is necessary to lock memory pages. Locking memory pages prevents
1124
the operating system from writing them to disk and thereby keeping your
1125
secret keys really secret. If you get no warning message about insecure
1126
memory your operating system supports locking without being root. The
1127
program drops root privileges as soon as locked memory is allocated.
1129
To setuid(root) permissions on the gpg binary you can either use:
1132
$ chmod u+s /path/to/gpg
1138
$ chmod 4755 /path/to/gpg
1141
Some refrain from using setuid(root) unless absolutely required for
1142
security reasons. Please check with your system administrator if you
1143
are not able to make these determinations yourself.
1145
On UnixWare 2.x and 7.x you should install GnuPG with the 'plock'
1146
privilege to get the same effect:
1149
$ filepriv -f plock /path/to/gpg
1152
If you can't or don't want to install GnuPG setuid(root), you can
1153
use the option "--no-secmem-warning" or put:
1159
in your ~/.gnupg/options or ~/.gnupg/gpg.conf file (this disables
1162
On some systems (e.g., Windows) GnuPG does not lock memory pages
1163
and older GnuPG versions (<=1.0.4) issue the warning:
1166
gpg: Please note that you don't have secure memory
1169
This warning can't be switched off by the above option because it
1170
was thought to be too serious an issue. However, it confused users
1171
too much, so the warning was eventually removed.
1174
<a NAME=q6.2>6.2)</a> Large File Support doesn't work ...
1177
LFS works correctly in post-1.0.4 versions. If configure doesn't
1178
detect it, try a different (i.e., better) compiler. egcs 1.1.2 works
1179
fine, other gccs sometimes don't. BTW, several compilation problems
1180
of GnuPG 1.0.3 and 1.0.4 on HP-UX and Solaris were due to broken LFS
1184
<a NAME=q6.3>6.3)</a> In the edit menu the trust values are not displayed correctly after
1188
This happens because some information is stored immediately in
1189
the trustdb, but the actual trust calculation can be done after the
1190
save command. This is a "not easy to fix" design bug which will be
1191
addressed in some future release.
1194
<a NAME=q6.4>6.4)</a> What does "skipping pubkey 1: already loaded" mean?
1197
As of GnuPG 1.0.3, the RSA algorithm is included. If you still have
1198
a "load-extension rsa" in your options file, the above message
1199
occurs. Just remove the load command from the options file.
1202
<a NAME=q6.5>6.5)</a> GnuPG 1.0.4 doesn't create ~/.gnupg ...
1205
That's a known bug, already fixed in newer versions.
1208
<a NAME=q6.6>6.6)</a> An Elgamal signature does not verify anymore since version 1.0.2 ...
1211
Use the option --emulate-md-encode-bug.
1214
<a NAME=q6.7>6.7)</a> Old versions of GnuPG can't verify Elgamal signatures
1217
Update to GnuPG 1.0.2 or newer.
1220
<a NAME=q6.8>6.8)</a> When I use --clearsign, the plain text has sometimes extra dashes
1224
This is called dash-escaped text and is required by OpenPGP.
1225
It always happens when a line starts with a dash ("-") and is
1226
needed to make the lines that structure signature and text
1227
(i.e., "-----BEGIN PGP SIGNATURE-----") to be the only lines
1228
that start with two dashes.
1230
If you use GnuPG to process those messages, the extra dashes
1231
are removed. Good mail clients remove those extra dashes when
1232
displaying such a message.
1235
<a NAME=q6.9>6.9)</a> What is the thing with "can't handle multiple signatures"?
1238
Due to different message formats GnuPG is not always able to split
1239
a file with multiple signatures unambiguously into its parts. This
1240
error message informs you that there is something wrong with the input.
1242
The only way to have multiple signatures in a file is by using the
1243
OpenPGP format with one-pass-signature packets (which is GnuPG's
1244
default) or the cleartext signed format.
1247
<a NAME=q6.10>6.10)</a> If I submit a key to a keyserver, nothing happens ...
1250
You are most likely using GnuPG 1.0.2 or older on Windows. That's
1251
feature isn't yet implemented, but it's a bug not to say it. Newer
1252
versions issue a warning. Upgrade to 1.4.5 or newer.
1255
<a NAME=q6.11>6.11)</a> I get "gpg: waiting for lock ..."
1258
A previous instance of gpg has most likely exited abnormally and left
1259
a lock file. Go to ~/.gnupg and look for .*.lock files and remove them.
1262
<a NAME=q6.12>6.12)</a> Older gpg binaries (e.g., 1.0) have problems with keys from newer
1266
As of 1.0.3, keys generated with gpg are created with preferences to
1267
TWOFISH (and AES since 1.0.4) and that also means that they have the
1268
capability to use the new MDC encryption method. This will go into
1269
OpenPGP soon, and is also suppoted by PGP 7. This new method avoids
1270
a (not so new) attack on all email encryption systems.
1272
This in turn means that pre-1.0.3 gpg binaries have problems with
1273
newer keys. Because of security and bug fixes, you should keep your
1274
GnuPG installation in a recent state anyway. As a workaround, you can
1275
force gpg to use a previous default cipher algo by putting:
1281
into your options file.
1284
<a NAME=q6.13>6.13)</a> With 1.0.4, I get "this cipher algorithm is deprecated ..."
1287
If you just generated a new key and get this message while
1288
encrypting, you've witnessed a bug in 1.0.4. It uses the new AES
1289
cipher Rijndael that is incorrectly being referred as "deprecated".
1290
Ignore this warning, more recent versions of gpg are corrected.
1293
<a NAME=q6.14>6.14)</a> Some dates are displayed as ????-??-??. Why?
1296
Due to constraints in most libc implementations, dates beyond
1297
2038-01-19 can't be displayed correctly. 64-bit OSes are not
1298
affected by this problem. To avoid printing wrong dates, GnuPG
1299
instead prints some question marks. To see the correct value, you
1300
can use the options --with-colons and --fixed-list-mode.
1303
<a NAME=q6.15>6.15)</a> I still have a problem. How do I report a bug?
1306
Are you sure that it's not been mentioned somewhere on the mailing
1307
lists? Did you have a look at the bug list (you'll find a link to
1308
the list of reported bugs on the documentation page). If you're not
1309
sure about it being a bug, you can send mail to the gnupg-devel
1310
list. Otherwise, use the bug tracking system
1311
<a href=http://bugs.gnupg.org><http://bugs.gnupg.org></a>.
1314
<a NAME=q6.16>6.16)</a> Why doesn't GnuPG support X.509 certificates?
1317
GnuPG, first and foremost, is an implementation of the OpenPGP
1318
standard (RFC 2440), which is a competing infrastructure, different
1321
They are both public-key cryptosystems, but how the public keys are
1322
actually handled is different.
1325
<a NAME=q6.17>6.17)</a> Why do national characters in my user ID look funny?
1328
According to OpenPGP, GnuPG encodes user ID strings (and other
1329
things) using UTF-8. In this encoding of Unicode, most national
1330
characters get encoded as two- or three-byte sequences. For
1331
example, &aring; (0xE5 in ISO-8859-1) becomes &Atilde;&yen; (0xC3,
1332
0xA5). This might also be the reason why keyservers can't find
1336
<a NAME=q6.18>6.18)</a> I get 'sed' errors when running ./configure on Mac OS X ...
1339
This will be fixed after GnuPG has been upgraded to autoconf-2.50.
1340
Until then, find the line setting CDPATH in the configure script
1350
<a NAME=q6.19>6.19)</a> Why does GnuPG 1.0.6 bail out on keyrings used with 1.0.7?
1353
There is a small bug in 1.0.6 which didn't parse trust packets
1354
correctly. You may want to apply this patch if you can't upgrade:
1356
<a href=http://www.gnupg.org/developer/gpg-woody-fix.txt><http://www.gnupg.org/developer/gpg-woody-fix.txt></a>
1359
<a NAME=q6.20>6.20)</a> I upgraded to GnuPG version 1.0.7 and now it takes longer to load my
1360
keyrings. What can I do?
1363
The way signature states are stored has changed so that v3 signatures
1364
can be supported. You can use the new --rebuild-keydb-caches migration
1365
command, which was built into this release and increases the speed of
1366
many operations for existing keyrings.
1369
<a NAME=q6.21>6.21)</a> Doesn't a fully trusted user ID on a key prevent warning messages
1370
when encrypting to other IDs on the key?
1373
No. That was actually a key validity bug in GnuPG 1.2.1 and earlier
1374
versions. As part of the development of GnuPG 1.2.2, a bug was
1375
discovered in the key validation code. This bug causes keys with
1376
more than one user ID to give all user IDs on the key the amount of
1377
validity given to the most-valid key. The bug has been fixed in GnuPG
1378
release 1.2.2, and upgrading is the recommended fix for this problem.
1379
More information and a patch for a some pre-1.2.2 versions of GnuPG
1382
<a href=http://lists.gnupg.org/pipermail/gnupg-announce/2003q2/000268.html><http://lists.gnupg.org/pipermail/gnupg-announce/2003q2/000268.html></a>
1385
<a NAME=q6.22>6.22)</a> I just compiled GnuPG from source on my GNU/Linux RPM-based system
1386
and it's not working. Why?
1389
Many GNU/Linux distributions that are RPM-based will install a
1390
version of GnuPG as part of its standard installation, placing the
1391
binaries in the /usr/bin directory. Later, compiling and installing
1392
GnuPG from source other than from a source RPM won't normally
1393
overwrite these files, as the default location for placement of
1394
GnuPG binaries is in /usr/local/bin unless the '--prefix' switch
1395
is used during compile to specify an alternate location. Since the
1396
/usr/bin directory more than likely appears in your path before
1397
/usr/local/bin, the older RPM-version binaries will continue to
1398
be used when called since they were not replaced.
1400
To resolve this, uninstall the RPM-based version with 'rpm -e gnupg'
1401
before installing the binaries compiled from source. If dependency
1402
errors are displayed when attempting to uninstall the RPM (such as
1403
when Red Hat's up2date is also installed, which uses GnuPG), uninstall
1404
the RPM with 'rpm -e gnupg --nodeps' to force the uninstall. Any
1405
dependent files should be automatically replaced during the install
1406
of the compiled version. If the default /usr/local/bin directory is
1407
used, some packages such as SuSE's Yast Online Update may need to be
1408
configured to look for GnuPG binaries in the /usr/local/bin directory,
1409
or symlinks can be created in /usr/bin that point to the binaries
1410
located in /usr/local/bin.
1414
<A NAME=q7>7. ADVANCED TOPICS
1418
<a NAME=q7.1>7.1)</a> How does this whole thing work?
1421
To generate a secret/public keypair, run:
1427
and choose the default values.
1429
Data that is encrypted with a public key can only be decrypted by
1430
the matching secret key. The secret key is protected by a password,
1431
the public key is not.
1433
So to send your friend a message, you would encrypt your message
1434
with his public key, and he would only be able to decrypt it by
1435
having the secret key and putting in the password to use his secret
1438
GnuPG is also useful for signing things. Files that are encrypted
1439
with the secret key can be decrypted with the public key. To sign
1440
something, a hash is taken of the data, and then the hash is in some
1441
form encoded with the secret key. If someone has your public key, they
1442
can verify that it is from you and that it hasn't changed by checking
1443
the encoded form of the hash with the public key.
1445
A keyring is just a large file that stores keys. You have a public
1446
keyring where you store yours and your friend's public keys. You have
1447
a secret keyring that you keep your secret key on, and should be very
1448
careful with. Never ever give anyone else access to it and use a *good*
1449
passphrase to protect the data in it.
1451
You can 'conventionally' encrypt something by using the option 'gpg -c'.
1452
It is encrypted using a passphrase, and does not use public and secret
1453
keys. If the person you send the data to knows that passphrase, they
1454
can decrypt it. This is usually most useful for encrypting things to
1455
yourself, although you can encrypt things to your own public key in the
1456
same way. It should be used for communication with partners you know
1457
and where it is easy to exchange the passphrases (e.g. with your boy
1458
friend or your wife). The advantage is that you can change the
1459
passphrase from time to time and decrease the risk, that many old
1460
messages may be decrypted by people who accidently got your passphrase.
1462
You can add and copy keys to and from your keyring with the 'gpg
1463
--import' and 'gpg --export' command. 'gpg --export-secret-keys' will
1464
export secret keys. This is normally not useful, but you can generate
1465
the key on one machine then move it to another machine.
1467
Keys can be signed under the 'gpg --edit-key' option. When you sign a
1468
key, you are saying that you are certain that the key belongs to the
1469
person it says it comes from. You should be very sure that is really
1470
that person: You should verify the key fingerprint with:
1473
$ gpg --fingerprint KeyID
1476
over the phone (if you really know the voice of the other person), at
1477
a key signing party (which are often held at computer conferences),
1478
or at a meeting of your local GNU/Linux User Group.
1480
Hmm, what else. You may use the option '-o filename' to force output
1481
to this filename (use '-' to force output to stdout). '-r' just lets
1482
you specify the recipient (which public key you encrypt with) on the
1483
command line instead of typing it interactively.
1485
Oh yeah, this is important. By default all data is encrypted in some
1486
weird binary format. If you want to have things appear in ASCII text
1487
that is readable, just add the '-a' option. But the preferred method
1488
is to use a MIME aware mail reader (Mutt, Pine and many more).
1490
There is a small security glitch in the OpenPGP (and therefore GnuPG)
1491
system; to avoid this you should always sign and encrypt a message
1492
instead of only encrypting it.
1495
<a NAME=q7.2>7.2)</a> Why are some signatures with an ELG-E key valid?
1498
These are Elgamal keys generated by GnuPG in v3 (RFC 1991) packets.
1499
The OpenPGP draft later changed the algorithm identifier for Elgamal
1500
keys which are usable for signatures and encryption from 16 to 20.
1501
GnuPG now uses 20 when it generates new Elgamal keys but still
1502
accepts 16 (which is according to OpenPGP "encryption only") if this
1503
key is in a v3 packet. GnuPG is the only program which had used
1504
these v3 Elgamal keys - so this assumption is quite safe.
1507
<a NAME=q7.3>7.3)</a> How does the whole trust thing work?
1510
It works more or less like PGP. The difference is that the trust is
1511
computed at the time it is needed. This is one of the reasons for
1512
the trustdb which holds a list of valid key signatures. If you are
1513
not running in batch mode you will be asked to assign a trust
1514
parameter (ownertrust) to a key.
1516
You can see the validity (calculated trust value) using this
1520
$ gpg --list-keys --with-colons
1523
If the first field is "pub" or "uid", the second field shows you the
1527
o = Unknown (this key is new to the system)
1528
e = The key has expired
1529
q = Undefined (no value assigned)
1530
n = Don't trust this key at all
1531
m = There is marginal trust in this key
1532
f = The key is full trusted
1533
u = The key is ultimately trusted; this is only used
1534
for keys for which the secret key is also available.
1535
r = The key has been revoked
1536
d = The key has been disabled
1539
The value in the "pub" record is the best one of all "uid" records.
1540
You can get a list of the assigned trust values (how much you trust
1541
the owner to correctly sign another person's key) with:
1544
$ gpg --list-ownertrust
1547
The first field is the fingerprint of the primary key, the second
1548
field is the assigned value:
1551
- = No ownertrust value yet assigned or calculated.
1552
n = Never trust this keyholder to correctly verify others signatures.
1553
m = Have marginal trust in the keyholders capability to sign other
1555
f = Assume that the key holder really knows how to sign keys.
1556
u = No need to trust ourself because we have the secret key.
1559
Keep these values confidential because they express your opinions
1560
about others. PGP stores this information with the keyring thus it
1561
is not a good idea to publish a PGP keyring instead of exporting the
1562
keyring. GnuPG stores the trust in the trustdb.gpg file so it is okay
1563
to give a gpg keyring away (but we have a --export command too).
1566
<a NAME=q7.4>7.4)</a> What kind of output is this: "key C26EE891.298, uid 09FB: ...."?
1569
This is the internal representation of a user ID in the trustdb.
1570
"C26EE891" is the keyid, "298" is the local ID (a record number in
1571
the trustdb) and "09FB" is the last two bytes of a ripe-md-160 hash
1572
of the user ID for this key.
1575
<a NAME=q7.5>7.5)</a> How do I interpret some of the informational outputs?
1578
While checking the validity of a key, GnuPG sometimes prints some
1579
information which is prefixed with information about the checked
1583
"key 12345678.3456"
1586
This is about the key with key ID 12345678 and the internal number
1587
3456, which is the record number of the so called directory record
1591
"uid 12345678.3456/ACDE"
1594
This is about the user ID for the same key. To identify the user ID
1595
the last two bytes of a ripe-md-160 over the user ID ring is printed.
1598
"sig 12345678.3456/ACDE/9A8B7C6D"
1601
This is about the signature with key ID 9A8B7C6D for the above key
1602
and user ID, if it is a signature which is direct on a key, the user
1603
ID part is empty (..//..).
1606
<a NAME=q7.6>7.6)</a> Are the header lines of a cleartext signature part of the signed
1610
No. For example you can add or remove "Comment:" lines. They have
1611
a purpose like the mail header lines. However a "Hash:" line is
1612
needed for OpenPGP signatures to tell the parser which hash
1616
<a NAME=q7.7>7.7)</a> What is the list of preferred algorithms?
1619
The list of preferred algorithms is a list of cipher, hash and
1620
compression algorithms stored in the self-signature of a key during
1621
key generation. When you encrypt a document, GnuPG uses this list
1622
(which is then part of a public key) to determine which algorithms
1623
to use. Basically it tells other people what algorithms the
1624
recipient is able to handle and provides an order of preference.
1627
<a NAME=q7.8>7.8)</a> How do I change the list of preferred algorithms?
1630
In version 1.0.7 or later, you can use the edit menu and set the
1631
new list of preference using the command "setpref"; the format of
1632
this command resembles the output of the command "pref". The
1633
preference is not changed immediately but the set preference will
1634
be used when a new user ID is created. If you want to update the
1635
preferences for existing user IDs, select those user IDs (or select
1636
none to update all) and enter the command "updpref". Note that the
1637
timestamp of the self-signature is increased by one second when
1638
running this command.
1641
<a NAME=q7.9>7.9)</a> How can I import all the missing signer keys?
1644
If you imported a key and you want to also import all the signer's
1645
keys, you can do this with this command:
1647
gpg --check-sigs --with-colon KEYID \
1648
| awk -F: '$1 == "sig" && $2 == "?" { print $5 }' \
1649
| sort | uniq | xargs echo gpg --recv-keys
1651
Note that the invocation of sort is also required to wait for the
1652
of the listing before before starting the import.
1656
<A NAME=q8>8. ACKNOWLEDGEMENTS
1659
Many thanks to Nils Ellmenreich for maintaining this FAQ file for
1660
such a long time, Werner Koch for the original FAQ file, and to all
1661
posters to gnupg-users and gnupg-devel. They all provided most of
1664
Also thanks to Casper Dik for providing us with a script to generate
1665
this FAQ (he uses it for the excellent Solaris2 FAQ).
1669
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.,
1670
51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
1672
Verbatim copying and distribution of this entire article is permitted in
1673
any medium, provided this notice is preserved.