2 [$htmlcharset=<meta http-equiv="content-type" content="text/html; charset=utf-8">]
3 [$sfaqheader=The GnuPG FAQ says:]
5 The most recent version of the FAQ is available from
6 <http://www.gnupg.org/>
10 [$maintainer=David D. Scribner, <faq 'at' gnupg.org>]
11 [$hGPGHTTP=http://www.gnupg.org]
12 [$hGPGFTP=ftp://ftp.gnupg.org]
15 [H body bgcolor=#ffffff text=#000000 link=#1f00ff alink=#ff0000 vlink=#9900dd]
16 [H h1]GnuPG Frequently Asked Questions[H /h1]
21 Last-Modified: Jul 30, 2003[H br]
22 Maintained-by: [$maintainer]
26 This is the GnuPG FAQ. The latest HTML version is available
27 [H a href=[$hGPGHTTP]/documentation/faqs.html]here[H/a].
29 The index is generated automatically, so there may be errors. Not all
30 questions may be in the section they belong to. Suggestions about how
31 to improve the structure of this FAQ are welcome.
33 Please send additions and corrections to the maintainer. It would be
34 most convenient if you could provide the answer to be included here
35 as well. Your help is very much appreciated!
37 Please, don't send message like "This should be a FAQ - what's the
38 answer?". If it hasn't been asked before, it isn't a FAQ. In that case
39 you could search in the mailing list archive.
50 [H a href=[$hGPGHTTP]]GnuPG[H /a] stands for GNU Privacy Guard and
51 is GNU's tool for secure communication and data storage. It can be
52 used to encrypt data and to create digital signatures. It includes
53 an advanced key management facility and is compliant with the
54 proposed OpenPGP Internet standard as described in [H a href=http://www.rfc-editor.org/]RFC 2440[H/a].
55 As such, it is aimed to be compatible with PGP from PGP Corp. and
58 <Q> Is GnuPG compatible with PGP?
60 In general, yes. GnuPG and newer PGP releases should be implementing
61 the OpenPGP standard. But there are some interoperability problems.
62 See question <Rcompat> for details.
64 <Q> Is GnuPG free to use for personal or commercial use?
66 Yes. GnuPG is part of the GNU family of tools and applications built
67 and provided in accordance with the Free Software Foundation (FSF)
68 General Public License (GPL). Therefore the software is free to copy,
69 use, modify and distribute in accordance with that license. Please
70 read the file titled COPYING that accompanies the application for
73 <Q> What conventions are used in this FAQ?
75 Although GnuPG is being developed for several operating systems
76 (often in parallel), the conventions used in this FAQ reflect a
77 UNIX shell environment. For Win32 users, references to a shell
78 prompt (`$') should be interpreted as a command prompt (`>'),
79 directory names separated by a forward slash (`/') may need to be
80 converted to a back slash (`\'), and a tilde (`~') represents a
81 user's "home" directory (reference question <Rhomedir> for an example).
83 Some command-lines presented in this FAQ are too long to properly
84 display in some browsers for the web page version of this file, and
85 have been split into two or more lines. For these commands please
86 remember to enter the entire command-string on one line or the
87 command will error, or at minimum not give the desired results.
89 Please keep in mind that this FAQ contains information that may not
90 apply to your particular version, as new features and bug fixes are
91 added on a continuing basis (reference the NEWS file included with
92 the source or package for noteworthy changes between versions). One
93 item to note is that starting with GnuPG version 1.1.92 the file
94 containing user options and settings has been renamed from "options"
95 to "gpg.conf". Information in the FAQ that relates to the options
96 file may be interchangable with the newer gpg.conf file in many
97 instances. See question <Roptions> for details.
100 <S> SOURCES of INFORMATION
102 <Q> Where can I find more information on GnuPG?
107 [H li]The documentation page is located at [H a href=[$hGPGHTTP]/documentation/]<[$hGPGHTTP]/documentation/>[H/a].
108 Also, have a look at the HOWTOs and the GNU Privacy Handbook (GPH,
109 available in English, Spanish and Russian). The latter provides a
110 detailed user's guide to GnuPG. You'll also find a document about how
111 to convert from PGP 2.x to GnuPG.
113 [H li]At [H a href=[$hGPGHTTP]/documentation/mailing-lists.html]<[$hGPGHTTP]/documentation/mailing-lists.html>[H/a] you'll find
114 an online archive of the GnuPG mailing lists. Most interesting should
115 be gnupg-users for all user-related issues and gnupg-devel if you want
116 to get in touch with the developers.
118 In addition, searchable archives can be found on MARC, e.g.: [H br]
119 gnupg-users: [H a href=http://marc.theaimsgroup.com/?l=gnupg-users&r=1&w=2]<http://marc.theaimsgroup.com/?l=gnupg-users&r=1&w=2>[H/a][H br]
120 gnupg-devel: [H a href=http://marc.theaimsgroup.com/?l=gnupg-devel&r=1&w=2]<http://marc.theaimsgroup.com/?l=gnupg-devel&r=1&w=2>[H/a][H br]
123 Before posting to a list, read this FAQ and the available documentation.
124 In addition, search the list archive - maybe your question has already
125 been discussed. This way you help people focus on topics that have not
128 [H li]The GnuPG source distribution contains a subdirectory:
134 where some additional documentation is located (mainly interesting
135 for hackers, not the casual user).
138 <Q> Where do I get GnuPG?
140 You can download the GNU Privacy Guard from its primary FTP server
141 [H a href=[$hGPGFTP]/gcrypt/]<[$hGPGFTP]/gcrypt/>[H /a] or from one of the mirrors:
143 [H a href=[$hGPGHTTP]/download/mirrors.html]
144 <[$hGPGHTTP]/download/mirrors.html>
147 The current stable version is [$hVERSION]. Please upgrade to this version as
148 it includes additional features, functions and security fixes that may
149 not have existed in prior versions.
154 <Q> Which OSes does GnuPG run on?
156 It should run on most Unices as well as Windows versions (including
157 Windows NT/2000) and Macintosh OS/X. A list of OSes reported to be OK
160 [H a href=[$hGPGHTTP]/download/supported_systems.html]
161 <[$hGPGHTTP]/download/supported_systems.html>
164 <Q> Which random data gatherer should I use?
166 "Good" random numbers are crucial for the security of your encryption.
167 Different operating systems provide a variety of more or less quality
168 random data. Linux and *BSD provide kernel generated random data
169 through /dev/random - this should be the preferred choice on these
170 systems. Also Solaris users with the SUNWski package installed have
171 a /dev/random. In these cases, use the configure option:
174 --enable-static-rnd=linux
177 In addition, there's also the kernel random device by Andi Maier
178 [H a href= http://www.cosy.sbg.ac.at/~andi/SUNrand/]<http://www.cosy.sbg.ac.at/~andi/SUNrand/>[H /a], but it's still beta. Use at your
181 On other systems, the Entropy Gathering Daemon (EGD) is a good choice.
182 It is a perl-daemon that monitors system activity and hashes it into
183 random data. See the download page [H a href=[$hGPGHTTP]/download/]<[$hGPGHTTP]/download/>[H /a]
187 --enable-static-rnd=egd
192 If the above options do not work, you can use the random number
193 generator "unix". This is [H B]very[H /B] slow and should be avoided. The
194 random quality isn't very good so don't use it on sensitive data.
197 <Q> How do I include support for RSA and IDEA?
199 RSA is included as of GnuPG version 1.0.3.
201 The official GnuPG distribution does not contain IDEA due to a patent
202 restriction. The patent does not expire before 2007 so don't expect
203 official support before then.
205 However, there is an unofficial module to include it even in earlier
206 versions of GnuPG. It's available from
207 [H a href=ftp://ftp.gnupg.dk/pub/contrib-dk/]<ftp://ftp.gnupg.dk/pub/contrib-dk/>[H /a]. Look for:
211 idea.c.gz.sig (signature file)
215 ideadll.zip (c module and win32 dll)
216 ideadll.zip.sig (signature file)
219 Compilation directives are in the headers of these files. You will
220 then need to add the following line to your ~/.gnupg/gpg.conf or
221 ~/.gnupg/options file:
230 <Q> What is the recommended key size?
232 1024 bit for DSA signatures; even for plain Elgamal signatures.
233 This is sufficient as the size of the hash is probably the weakest
234 link if the key size is larger than 1024 bits. Encryption keys may
235 have greater sizes, but you should then check the fingerprint of
239 $ gpg --fingerprint <user ID>
242 As for the key algorithms, you should stick with the default (i.e.,
243 DSA signature and Elgamal encryption). An Elgamal signing key has
244 the following disadvantages: the signature is larger, it is hard
245 to create such a key useful for signatures which can withstand some
246 real world attacks, you don't get any extra security compared to
247 DSA, and there might be compatibility problems with certain PGP
248 versions. It has only been introduced because at the time it was
249 not clear whether there was a patent on DSA.
251 <Q> Why does it sometimes take so long to create keys?
253 The problem here is that we need a lot of random bytes and for that
254 we (on Linux the /dev/random device) must collect some random data.
255 It is really not easy to fill the Linux internal entropy buffer; I
256 talked to Ted Ts'o and he commented that the best way to fill the
257 buffer is to play with your keyboard. Good security has its price.
258 What I do is to hit several times on the shift, control, alternate,
259 and caps lock keys, because these keys do not produce output to the
260 screen. This way you get your keys really fast (it's the same thing
263 Another problem might be another program which eats up your random
264 bytes (a program (look at your daemons) that reads from /dev/random).
266 <Q> And it really takes long when I work on a remote system. Why?
268 Don't do this at all! You should never create keys or even use GnuPG
269 on a remote system because you normally have no physical control
270 over your secret key ring (which is in most cases vulnerable to
271 advanced dictionary attacks) - I strongly encourage everyone to only
272 create keys on a local computer (a disconnected laptop is probably
273 the best choice) and if you need it on your connected box (I know,
274 we all do this) be sure to have a strong password for both your
275 account and for your secret key, and that you can trust your system
278 When I check GnuPG on a remote system via ssh (I have no Alpha here)
279 ;-) I have the same problem. It takes a *very* long time to create
280 the keys, so I use a special option, --quick-random, to generate
281 insecure keys which are only good for some tests.
283 <Q> What is the difference between options and commands?
285 If you do a 'gpg --help', you will get two separate lists. The first
286 is a list of commands. The second is a list of options. Whenever you
287 run GPG, you [H b]must[H /b] pick exactly one command (with one exception,
288 see below). You [H b]may[H /b] pick one or more options. The command should,
289 just by convention, come at the end of the argument list, after all
290 the options. If the command takes a file (all the basic ones do),
291 the filename comes at the very end. So the basic way to run gpg is:
294 $ gpg [--option something] [--option2] [--option3 something] --command file
297 Some options take arguments. For example, the --output option (which
298 can be abbreviated as -o) is an option that takes a filename. The
299 option's argument must follow immediately after the option itself,
300 otherwise gpg doesn't know which option the argument is supposed to
301 paired with. As an option, --output and its filename must come before
302 the command. The --recipient (-r) option takes a name or keyID to
303 encrypt the message to, which must come right after the -r option.
304 The --encrypt (or -e) command comes after all the options and is
305 followed by the file you wish to encrypt. Therefore in this example
306 the command-line issued would be:
309 $ gpg -r alice -o secret.txt -e test.txt
312 If you write the options out in full, it is easier to read:
315 $ gpg --recipient alice --output secret.txt --encrypt test.txt
318 If you're encrypting to a file with the extension ".txt", then you'd
319 probably expect to see ASCII-armored text in the file (not binary),
320 so you need to add the --armor (-a) option, which doesn't take any
324 $ gpg --armor --recipient alice --output secret.txt --encrypt test.txt
327 If you imagine square brackets around the optional parts, it becomes
331 $ gpg [--armor] [--recipient alice] [--output secret.txt] --encrypt test.txt
334 The optional parts can be rearranged any way you want:
337 $ gpg --output secret.txt --recipient alice --armor --encrypt test.txt
340 If your filename begins with a hyphen (e.g. "-a.txt"), GnuPG assumes
341 this is an option and may complain. To avoid this you have to either
342 use "./-a.txt", or stop the option and command processing with two
343 hyphens: "-- -a.txt".
345 [H B]The exception to using only one command:[H /B] signing and encrypting
346 at the same time. For this you can combine both commands, such as in:
349 $ gpg [--options] --sign --encrypt foo.txt
352 <Q> I can't delete a user ID on my secret keyring because it has
353 already been deleted on my public keyring. What can I do?
355 Because you can only select from the public key ring, there is no
356 direct way to do this. However it is not very complicated to do
357 anyway. Create a new user ID with exactly the same name and you
358 will see that there are now two identical user IDs on the secret
359 ring. Now select this user ID and delete it. Both user IDs will be
360 removed from the secret ring.
362 <Q> I can't delete my secret key because the public key disappeared.
365 To select a key a search is always done on the public keyring,
366 therefore it is not possible to select a secret key without
367 having the public key. Normally it should never happen that the
368 public key got lost but the secret key is still available. The
369 reality is different, so GnuPG implements a special way to deal
370 with it: Simply use the long keyID to specify the key to delete,
371 which can be obtained by using the --with-colons options (it is
372 the fifth field in the lines beginning with "sec").
374 If you've lost your public key and need to recreate it instead
375 for continued use with your secret key, you may be able to use
376 gpgsplit as detailed in question <Rgpgsplit>.
378 <Q> What are trust, validity and ownertrust?
380 With GnuPG, the term "ownertrust" is used instead of "trust" to
381 help clarify that this is the value you have assigned to a key
382 to express how much you trust the owner of this key to correctly
383 sign (and thereby introduce) other keys. The "validity", or
384 calculated trust, is a value which indicates how much GnuPG
385 considers a key as being valid (that it really belongs to the
386 one who claims to be the owner of the key). For more information
387 on trust values see the chapter "The Web of Trust" in The GNU
390 <Q> How do I sign a patch file?
392 Use "gpg --clearsign --not-dash-escaped ...". The problem with
393 --clearsign is that all lines starting with a dash are quoted with
394 "- "; obviously diff produces many lines starting with a dash and
395 these are then quoted and that is not good for a patch ;-). To use
396 a patch file without removing the cleartext signature, the special
397 option --not-dash-escaped may be used to suppress generation of
398 these escape sequences. You should not mail such a patch because
399 spaces and line endings are also subject to the signature and a
400 mailer may not preserve these. If you want to mail a file you can
401 simply sign it using your MUA (Mail User Agent).
403 <Q> Where is the "encrypt-to-self" option?
405 Use "--encrypt-to your_keyID". You can use more than one of these
406 options. To temporarily override the use of this additional key,
407 you can use the option "--no-encrypt-to".
409 <Q> How can I get rid of the Version and Comment headers in armored
412 Use "--no-version --comment ''". Note that the left over blank line
413 is required by the protocol.
415 <Q> What does the "You are using the xxxx character set." mean?
417 This note is printed when UTF-8 mapping has to be done. Make sure
418 that the displayed character set is the one you have activated on
419 your system. Since "iso-8859-1" is the character set most used,
420 this is the default. You can change the charset with the option
421 "--charset". It is important that your active character set matches
422 the one displayed - if not, restrict yourself to plain 7 bit ASCII
423 and no mapping has to be done.
425 <Q> How can I get list of key IDs used to encrypt a message?
428 $ gpg --batch --decrypt --list-only --status-fd 1 2>/dev/null |
429 awk '/^\[GNUPG:\] ENC_TO / { print $3 }'
432 <Q> Why can't I decrypt files encrypted as symmetrical-only (-c) with
433 a version of GnuPG prior to 1.0.1.
435 There was a bug in GnuPG versions prior to 1.0.1 which affected files
436 only if 3DES or Twofish was used for symmetric-only encryption (this has
437 never been the default). The bug has been fixed, but to enable decryption
438 of old files you should run gpg with the option "--emulate-3des-s2k-bug",
439 decrypt the file and encrypt it again without this option.
441 NOTE: This option was removed in GnuPG development version 1.1.0 and later
442 updates, so you will need to use a version between 1.0.1 and 1.0.7 to
443 re-encrypt any affected files.
445 <Q> How can I use GnuPG in an automated environment?
447 You should use the option --batch and don't use passphrases as
448 there is usually no way to store it more securely than on the
449 secret keyring itself. The suggested way to create keys for an
450 automated environment is:
454 [H li] If you want to do automatic signing, create a signing subkey
455 for your key (use the interactive key editing menu by issueing
456 the command 'gpg --edit-key keyID', enter "addkey" and select
458 [H li] Make sure that you use a passphrase (needed by the current
460 [H li] gpg --export-secret-subkeys --no-comment foo >secring.auto
461 [H li] Copy secring.auto and the public keyring to a test directory.
462 [H li] Change to this directory.
463 [H li] gpg --homedir . --edit foo and use "passwd" to remove the
464 passphrase from the subkeys. You may also want to remove all
466 [H li] Copy secring.auto to a floppy and carry it to the target box.
469 On the target machine:
471 [H li] Install secring.auto as the secret keyring.
472 [H li] Now you can start your new service. It's also a good idea to
473 install an intrusion detection system so that you hopefully
474 get a notice of an successful intrusion, so that you in turn
475 can revoke all the subkeys installed on that machine and
479 <Q> Which email-client can I use with GnuPG?
481 Using GnuPG to encrypt email is one of the most popular uses.
482 Several mail clients or mail user agents (MUAs) support GnuPG to
483 varying degrees. Simplifying a bit, there are two ways mail can be
484 encrypted with GnuPG: the "old style" ASCII armor (i.e. cleartext
485 encryption), and RFC 2015 style (previously PGP/MIME, now OpenPGP).
486 The latter has full MIME support. Some MUAs support only one of
487 them, so whichever you actually use depends on your needs as well
488 as the capabilities of your addressee. As well, support may be
489 native to the MUA, or provided via "plug-ins" or external tools.
491 The following list is not exhaustive:
494 MUA OpenPGP ASCII How? (N,P,T)
495 -------------------------------------------------------------
496 Calypso N Y P (Unixmail)
497 Elm N Y T (mailpgp,morepgp)
499 Emacs/Gnus Y Y T (Mailcrypt,gpg.el)
501 Emacs/VM N Y T (Mailcrypt)
504 GNUMail.app Y Y P (PGPBundle)
506 KMail (<=1.4.x) N Y N
507 KMail (1.5.x) Y(P) Y(N) P/N
508 Mozilla Y Y P (Enigmail)
514 XEmacs/Gnus Y Y T (Mailcrypt)
516 XEmacs/VM N Y T (Mailcrypt)
519 N - Native, P - Plug-in, T - External Tool
522 The following table lists proprietary MUAs. The GNU Project
523 suggests against the use of these programs, but they are listed
524 for interoperability reasons for your convenience.
527 MUA OpenPGP ASCII How? (N,P,T)
528 -------------------------------------------------------------
529 Apple Mail Y Y P (GPGMail)
530 Becky2 Y Y P (BkGnuPG)
531 Eudora Y Y P (EuroraGPG)
532 Eudora Pro Y Y P (EudoraGPG)
535 Netscape 7.x Y Y P (Enigmail)
536 Novell Groupwise N Y P
537 Outlook N Y P (G-Data)
538 Outlook Express N Y P (GPGOE)
539 Pegasus N Y P (QDPGP,PM-PGP)
540 Pine N Y T (pgpenvelope,(gpg|pgp)4pine)
541 Postme N Y P (GPGPPL)
542 The Bat! N Y P (Ritlabs)
545 Good overviews of OpenPGP-support can be found at:[H br]
546 [H a href=http://www.openpgp.fr.st/courrier_en.html]<http://www.openpgp.fr.st/courrier_en.html>[H /a] and[H br]
547 [H a href=http://www.bretschneidernet.de/tips/secmua.html]<http://www.bretschneidernet.de/tips/secmua.html>[H /a].
549 Users of Win32 MUAs that lack OpenPGP support may look into
550 using GPGrelay [H a href=http://gpgrelay.sourceforge.net]<http://gpgrelay.sourceforge.net>[H /a], a small
551 email-relaying server that uses GnuPG to enable many email clients
552 to send and receive emails that conform to PGP-MIME (RFC 2015).
554 <Q> Can't we have a gpg library?
556 This has been frequently requested. However, the current viewpoint
557 of the GnuPG maintainers is that this would lead to several security
558 issues and will therefore not be implemented in the foreseeable
559 future. However, for some areas of application gpgme could do the
560 trick. You'll find it at [H a href=[$hGPGFTP]/gcrypt/alpha/gpgme]<[$hGPGFTP]/gcrypt/alpha/gpgme>[H /a].
562 <Q> I have successfully generated a revocation certificate, but I don't
563 understand how to send it to the key servers.
565 Most keyservers don't accept a 'bare' revocation certificate. You
566 have to import the certificate into gpg first:
569 $ gpg --import my-revocation.asc
572 then send the revoked key to the keyservers:
575 $ gpg --keyserver certserver.pgp.com --send-keys mykeyid
578 (or use a keyserver web interface for this).
581 <Q> How do I put my keyring in a different directory?
583 GnuPG keeps several files in a special homedir directory. These
584 include the options file, pubring.gpg, secring.gpg, trustdb.gpg,
585 and others. GnuPG will always create and use these files. On unices,
586 the homedir is usually ~/.gnupg; on Windows "C:\gnupg\".
588 If you want to put your keyrings somewhere else, use the option:
594 to make GnuPG create all its files in that directory. Your keyring
595 will be "/my/path/pubring.gpg". This way you can store your secrets
596 on a floppy disk. Don't use "--keyring" as its purpose is to specify
597 additional keyring files.
599 <Q> How do I verify signed packages?
601 Before you can verify the signature that accompanies a package,
602 you must first have the vendor, organisation, or issueing person's
603 key imported into your public keyring. To prevent GnuPG warning
604 messages the key should also be validated (or locally signed).
606 You will also need to download the detached signature file along
607 with the package. These files will usually have the same name as
608 the package, with either a binary (.sig) or ASCII armor (.asc)
611 Once their key has been imported, and the package and accompanying
612 signature files have been downloaded, use:
615 $ gpg --verify sigfile signed-file
618 If the signature file has the same base name as the package file,
619 the package can also be verified by specifying just the signature
620 file, as GnuPG will derive the package's file name from the name
621 given (less the .sig or .asc extension). For example, to verify a
622 package named foobar.tar.gz against its detached binary signature
626 $ gpg --verify foobar.tar.gz.sig
629 <Q> How do I export a keyring with only selected signatures (keys)?
631 If you're wanting to create a keyring with only a subset of keys
632 selected from a master keyring (for a club, user group, or company
633 department for example), simply specify the keys you want to export:
636 $ gpg --armor --export key1 key2 key3 key4 > keys1-4.asc
640 <Q> I still have my secret key, but lost my public key. What can I do?
642 All OpenPGP secret keys have a copy of the public key inside them,
643 and in a worst-case scenario, you can create yourself a new public
644 key using the secret key.
646 A tool to convert a secret key into a public one has been included
647 (it's actually a new option for gpgsplit) and is available with GnuPG
648 versions 1.2.1 or later (or can be found in CVS). It works like this:
651 $ gpgsplit --no-split --secret-to-public secret.gpg >publickey.gpg
654 One should first try to export the secret key and convert just this
655 one. Using the entire secret keyring should work too. After this has
656 been done, the publickey.gpg file can be imported into GnuPG as usual.
658 <Q> Clearsigned messages sent from my web-mail account have an invalid
661 Check to make sure the settings for your web-based email account
662 do not use HTML formatting for the pasted clearsigned message. This can
663 alter the message with embedded HTML markup tags or spaces, resulting
664 in an invalid signature. The recipient may be able to copy the signed
665 message block to a text file for verification, or the web email
666 service may allow you to attach the clearsigned message as a file
667 if plaintext messages are not an option.
670 <S> COMPATIBILITY ISSUES
673 <Q> How can I encrypt a message with GnuPG so that PGP is able to decrypt it?
675 It depends on the PGP version.
679 You can't do that because PGP 2.x normally uses IDEA which is not
680 supported by GnuPG as it is patented (see <Ridea>), but if you have a
681 modified version of PGP you can try this:
684 $ gpg --rfc1991 --cipher-algo 3des ...
687 Please don't pipe the data to encrypt to gpg but provide it using a
688 filename; otherwise, PGP 2 will not be able to handle it.
690 As for conventional encryption, you can't do this for PGP 2.
692 [H li]PGP 5.x and higher[H br]
693 You need to provide two additional options:
696 --compress-algo 1 --cipher-algo cast5
699 You may also use "3des" instead of "cast5", and "blowfish" does not
700 work with all versions of PGP 5. You may also want to put:
706 into your ~/.gnupg/options file - this does not affect normal GnuPG
709 This applies to conventional encryption as well.
712 <Q> How do I migrate from PGP 2.x to GnuPG?
714 PGP 2 uses the RSA and IDEA encryption algorithms. Whereas the RSA
715 patent has expired and RSA is included as of GnuPG 1.0.3, the IDEA
716 algorithm is still patented until 2007. Under certain conditions you
717 may use IDEA even today. In that case, you may refer to Question
718 <Ridea> about how to add IDEA support to GnuPG and read
719 [H a href=[$hGPGHTTP]/gph/en/pgp2x.html]<[$hGPGHTTP]/gph/en/pgp2x.html>[H /a] to perform the migration.
725 <Q> Why is PGP 5.x not able to encrypt messages with some keys?
727 PGP, Inc. refuses to accept Elgamal keys of type 20 even for
728 encryption. They only support type 16 (which is identical at least
729 for decryption). To be more inter-operable, GnuPG (starting with
730 version 0.3.3) now also uses type 16 for the Elgamal subkey which is
731 created if the default key algorithm is chosen. You may add a type
732 16 Elgamal key to your public key, which is easy as your key
733 signatures are still valid.
735 <Q> Why is PGP 5.x not able to verify my messages?
737 PGP 5.x does not accept v4 signatures for data material but OpenPGP
738 requests generation of v4 signatures for all kind of data, that's why
739 GnuPG defaults to them. Use the option "--force-v3-sigs" to generate
740 v3 signatures for data.
742 <Q> How do I transfer owner trust values from PGP to GnuPG?
744 There is a script in the tools directory to help you. After you have
745 imported the PGP keyring you can give this command:
748 $ lspgpot pgpkeyring | gpg --import-ownertrust
751 where pgpkeyring is the original keyring and not the GnuPG keyring
752 you might have created in the first step.
754 <Q> PGP does not like my secret key.
756 Older PGPs probably bail out on some private comment packets used by
757 GnuPG. These packets are fully in compliance with OpenPGP; however
758 PGP is not really OpenPGP aware. A workaround is to export the
759 secret keys with this command:
762 $ gpg --export-secret-keys --no-comment -a your-KeyID
765 Another possibility is this: by default, GnuPG encrypts your secret
766 key using the Blowfish symmetric algorithm. Older PGPs will only
767 understand 3DES, CAST5, or IDEA symmetric algorithms. Using the
768 following method you can re-encrypt your secret gpg key with a
772 $ gpg --s2k-cipher-algo=CAST5 --s2k-digest-algo=SHA1
773 --compress-algo=1 --edit-key <username>
776 Then use passwd to change the password (just change it to the same
777 thing, but it will encrypt the key with CAST5 this time).
779 Now you can export it and PGP should be able to handle it.
781 For PGP 6.x the following options work to export a key:
784 $ gpg --s2k-cipher-algo 3des --compress-algo 1 --rfc1991
785 --export-secret-keys <KeyID>
789 <Q> GnuPG no longer installs a ~/.gnupg/options file. Is it missing?
791 No. The ~/.gnupg/options file has been renamed to ~/.gnupg/gpg.conf for
792 new installs as of version 1.1.92. If an existing ~/.gnupg/options file
793 is found during an upgrade it will still be used, but this change was
794 required to have a more consistent naming scheme with forthcoming tools.
795 An existing options file can be renamed to gpg.conf for users upgrading,
796 or receiving the message that the "old default options file" is ignored
797 (occurs if both a gpg.conf and an options file are found).
799 <Q> How do you export GnuPG keys for use with PGP?
801 This has come up fairly often, so here's the HOWTO:
803 PGP can (for most key types) use secret keys generated by GnuPG. The
804 problems that come up occasionally are generally because GnuPG
805 supports a few more features from the OpenPGP standard than PGP does.
806 If your secret key has any of those features in use, then PGP will
807 reject the key or you will have problems communicating later. Note
808 that PGP doesn't do Elgamal signing keys at all, so they are not
809 usable with any version.
811 These instructions should work for GnuPG 1.0.7 and later, and PGP
814 Start by editing the key. Most of this line is not really necessary
815 as the default values are correct, but it does not hurt to repeat the
816 values, as this will override them in case you have something else set
817 in your options file.
820 $ gpg --s2k-cipher-algo cast5 --s2k-digest-algo sha1 --s2k-mode 3
821 --simple-sk-checksum --edit KeyID
824 Turn off some features. Set the list of preferred ciphers, hashes,
825 and compression algorithms to things that PGP can handle. (Yes, I
826 know this is an odd list of ciphers, but this is what PGP itself uses,
830 > setpref S9 S8 S7 S3 S2 S10 H2 H3 Z1 Z0
833 Now put the list of preferences onto the key.
839 Finally we must decrypt and re-encrypt the key, making sure that we
840 encrypt with a cipher that PGP likes. We set this up in the --edit
841 line above, so now we just need to change the passphrase to make it
842 take effect. You can use the same passphrase if you like, or take
843 this opportunity to actually change it.
855 Now we can do the usual export:
858 $ gpg --export KeyID > mypublickey.pgp[H br]
859 $ gpg --export-secret-key KeyID > mysecretkey.pgp
862 Thanks to David Shaw for this information!
865 <S> PROBLEMS and ERROR MESSAGES
867 <Q> Why do I get "gpg: Warning: using insecure memory!"
869 On many systems this program should be installed as setuid(root).
870 This is necessary to lock memory pages. Locking memory pages prevents
871 the operating system from writing them to disk and thereby keeping your
872 secret keys really secret. If you get no warning message about insecure
873 memory your operating system supports locking without being root. The
874 program drops root privileges as soon as locked memory is allocated.
876 To setuid(root) permissions on the gpg binary you can either use:
879 $ chmod u+s /path/to/gpg
885 $ chmod 4755 /path/to/gpg
888 Some refrain from using setuid(root) unless absolutely required for
889 security reasons. Please check with your system administrator if you
890 are not able to make these determinations yourself.
892 On UnixWare 2.x and 7.x you should install GnuPG with the 'plock'
893 privilege to get the same effect:
896 $ filepriv -f plock /path/to/gpg
899 If you can't or don't want to install GnuPG setuid(root), you can
900 use the option "--no-secmem-warning" or put:
906 in your ~/.gnupg/options or ~/.gnupg/gpg.conf file (this disables
909 On some systems (e.g., Windows) GnuPG does not lock memory pages
910 and older GnuPG versions (<=1.0.4) issue the warning:
913 gpg: Please note that you don't have secure memory
916 This warning can't be switched off by the above option because it
917 was thought to be too serious an issue. However, it confused users
918 too much, so the warning was eventually removed.
920 <Q> Large File Support doesn't work ...
922 LFS works correctly in post-1.0.4 versions. If configure doesn't
923 detect it, try a different (i.e., better) compiler. egcs 1.1.2 works
924 fine, other gccs sometimes don't. BTW, several compilation problems
925 of GnuPG 1.0.3 and 1.0.4 on HP-UX and Solaris were due to broken LFS
928 <Q> In the edit menu the trust values are not displayed correctly after
931 This happens because some information is stored immediately in
932 the trustdb, but the actual trust calculation can be done after the
933 save command. This is a "not easy to fix" design bug which will be
934 addressed in some future release.
936 <Q> What does "skipping pubkey 1: already loaded" mean?
938 As of GnuPG 1.0.3, the RSA algorithm is included. If you still have
939 a "load-extension rsa" in your options file, the above message
940 occurs. Just remove the load command from the options file.
942 <Q> GnuPG 1.0.4 doesn't create ~/.gnupg ...
944 That's a known bug, already fixed in newer versions.
946 <Q> An Elgamal signature does not verify anymore since version 1.0.2 ...
948 Use the option --emulate-md-encode-bug.
950 <Q> Old versions of GnuPG can't verify Elgamal signatures
952 Update to GnuPG 1.0.2 or newer.
954 <Q> When I use --clearsign, the plain text has sometimes extra dashes
957 This is called dash-escaped text and is required by OpenPGP.
958 It always happens when a line starts with a dash ("-") and is
959 needed to make the lines that structure signature and text
960 (i.e., "-----BEGIN PGP SIGNATURE-----") to be the only lines
961 that start with two dashes.
963 If you use GnuPG to process those messages, the extra dashes
964 are removed. Good mail clients remove those extra dashes when
965 displaying such a message.
967 <Q> What is the thing with "can't handle multiple signatures"?
969 Due to different message formats GnuPG is not always able to split
970 a file with multiple signatures unambiguously into its parts. This
971 error message informs you that there is something wrong with the input.
973 The only way to have multiple signatures in a file is by using the
974 OpenPGP format with one-pass-signature packets (which is GnuPG's
975 default) or the cleartext signed format.
977 <Q> If I submit a key to a keyserver, nothing happens ...
979 You are most likely using GnuPG 1.0.2 or older on Windows. That's
980 feature isn't yet implemented, but it's a bug not to say it. Newer
981 versions issue a warning. Upgrade to 1.0.4 or newer.
983 <Q> I get "gpg: waiting for lock ..."
985 A previous instance of gpg has most likely exited abnormally and left
986 a lock file. Go to ~/.gnupg and look for .*.lock files and remove them.
988 <Q> Older gpg binaries (e.g., 1.0) have problems with keys from newer
991 As of 1.0.3, keys generated with gpg are created with preferences to
992 TWOFISH (and AES since 1.0.4) and that also means that they have the
993 capability to use the new MDC encryption method. This will go into
994 OpenPGP soon, and is also suppoted by PGP 7. This new method avoids
995 a (not so new) attack on all email encryption systems.
997 This in turn means that pre-1.0.3 gpg binaries have problems with
998 newer keys. Because of security and bug fixes, you should keep your
999 GnuPG installation in a recent state anyway. As a workaround, you can
1000 force gpg to use a previous default cipher algo by putting:
1006 into your options file.
1008 <Q> With 1.0.4, I get "this cipher algorithm is deprecated ..."
1010 If you just generated a new key and get this message while
1011 encrypting, you've witnessed a bug in 1.0.4. It uses the new AES
1012 cipher Rijndael that is incorrectly being referred as "deprecated".
1013 Ignore this warning, more recent versions of gpg are corrected.
1015 <Q> Some dates are displayed as ????-??-??. Why?
1017 Due to constraints in most libc implementations, dates beyond
1018 2038-01-19 can't be displayed correctly. 64-bit OSes are not
1019 affected by this problem. To avoid printing wrong dates, GnuPG
1020 instead prints some question marks. To see the correct value, you
1021 can use the options --with-colons and --fixed-list-mode.
1023 <Q> I still have a problem. How do I report a bug?
1025 Are you sure that it's not been mentioned somewhere on the mailing
1026 lists? Did you have a look at the bug list (you'll find a link to
1027 the list of reported bugs on the documentation page). If you're not
1028 sure about it being a bug, you can send mail to the gnupg-devel
1029 list. Otherwise, use the GUUG bug tracking system
1030 [H a href=http://bugs.guug.de/Reporting.html]<http://bugs.guug.de/Reporting.html>[H /a].
1032 <Q> Why doesn't GnuPG support X.509 certificates?
1034 GnuPG, first and foremost, is an implementation of the OpenPGP
1035 standard (RFC 2440), which is a competing infrastructure, different
1038 They are both public-key cryptosystems, but how the public keys are
1039 actually handled is different.
1041 <Q> Why do national characters in my user ID look funny?
1043 According to OpenPGP, GnuPG encodes user ID strings (and other
1044 things) using UTF-8. In this encoding of Unicode, most national
1045 characters get encoded as two- or three-byte sequences. For
1046 example, å (0xE5 in ISO-8859-1) becomes Ã¥ (0xC3,
1047 0xA5). This might also be the reason why keyservers can't find
1050 <Q> I get 'sed' errors when running ./configure on Mac OS X ...
1052 This will be fixed after GnuPG has been upgraded to autoconf-2.50.
1053 Until then, find the line setting CDPATH in the configure script
1062 <Q> Why does GnuPG 1.0.6 bail out on keyrings used with 1.0.7?
1064 There is a small bug in 1.0.6 which didn't parse trust packets
1065 correctly. You may want to apply this patch if you can't upgrade:
1067 [H a href=http://www.gnupg.org/developer/gpg-woody-fix.txt]<http://www.gnupg.org/developer/gpg-woody-fix.txt>[H /a]
1069 <Q> I upgraded to GnuPG version 1.0.7 and now it takes longer to load my
1070 keyrings. What can I do?
1072 The way signature states are stored has changed so that v3 signatures
1073 can be supported. You can use the new --rebuild-keydb-caches migration
1074 command, which was built into this release and increases the speed of
1075 many operations for existing keyrings.
1077 <Q> Doesn't a fully trusted user ID on a key prevent warning messages
1078 when encrypting to other IDs on the key?
1080 No. That was actually a key validity bug in GnuPG 1.2.1 and earlier
1081 versions. As part of the development of GnuPG 1.2.2, a bug was
1082 discovered in the key validation code. This bug causes keys with
1083 more than one user ID to give all user IDs on the key the amount of
1084 validity given to the most-valid key. The bug has been fixed in GnuPG
1085 release 1.2.2, and upgrading is the recommended fix for this problem.
1086 More information and a patch for a some pre-1.2.2 versions of GnuPG
1089 [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]
1091 <Q> I just compiled GnuPG from source on my GNU/Linux RPM-based system
1092 and it's not working. Why?
1094 Many GNU/Linux distributions that are RPM-based will install a
1095 version of GnuPG as part of its standard installation, placing the
1096 binaries in the /usr/bin directory. Later, compiling and installing
1097 GnuPG from source other than from a source RPM won't normally
1098 overwrite these files, as the default location for placement of
1099 GnuPG binaries is in /usr/local/bin unless the '--prefix' switch
1100 is used during compile to specify an alternate location. Since the
1101 /usr/bin directory more than likely appears in your path before
1102 /usr/local/bin, the older RPM-version binaries will continue to
1103 be used when called since they were not replaced.
1105 To resolve this, uninstall the RPM-based version with 'rpm -e gnupg'
1106 before installing the binaries compiled from source. If dependency
1107 errors are displayed when attempting to uninstall the RPM (such as
1108 when Red Hat's up2date is also installed, which uses GnuPG), uninstall
1109 the RPM with 'rpm -e gnupg --nodeps' to force the uninstall. Any
1110 dependent files should be automatically replaced during the install
1111 of the compiled version. If the default /usr/local/bin directory is
1112 used, some packages such as SuSE's Yast Online Update may need to be
1113 configured to look for GnuPG binaries in the /usr/local/bin directory,
1114 or symlinks can be created in /usr/bin that point to the binaries
1115 located in /usr/local/bin.
1120 <Q> How does this whole thing work?
1122 To generate a secret/public keypair, run:
1128 and choose the default values.
1130 Data that is encrypted with a public key can only be decrypted by
1131 the matching secret key. The secret key is protected by a password,
1132 the public key is not.
1134 So to send your friend a message, you would encrypt your message
1135 with his public key, and he would only be able to decrypt it by
1136 having the secret key and putting in the password to use his secret
1139 GnuPG is also useful for signing things. Files that are encrypted
1140 with the secret key can be decrypted with the public key. To sign
1141 something, a hash is taken of the data, and then the hash is in some
1142 form encoded with the secret key. If someone has your public key, they
1143 can verify that it is from you and that it hasn't changed by checking
1144 the encoded form of the hash with the public key.
1146 A keyring is just a large file that stores keys. You have a public
1147 keyring where you store yours and your friend's public keys. You have
1148 a secret keyring that you keep your secret key on, and should be very
1149 careful with. Never ever give anyone else access to it and use a *good*
1150 passphrase to protect the data in it.
1152 You can 'conventionally' encrypt something by using the option 'gpg -c'.
1153 It is encrypted using a passphrase, and does not use public and secret
1154 keys. If the person you send the data to knows that passphrase, they
1155 can decrypt it. This is usually most useful for encrypting things to
1156 yourself, although you can encrypt things to your own public key in the
1157 same way. It should be used for communication with partners you know
1158 and where it is easy to exchange the passphrases (e.g. with your boy
1159 friend or your wife). The advantage is that you can change the
1160 passphrase from time to time and decrease the risk, that many old
1161 messages may be decrypted by people who accidently got your passphrase.
1163 You can add and copy keys to and from your keyring with the 'gpg
1164 --import' and 'gpg --export' command. 'gpg --export-secret-keys' will
1165 export secret keys. This is normally not useful, but you can generate
1166 the key on one machine then move it to another machine.
1168 Keys can be signed under the 'gpg --edit-key' option. When you sign a
1169 key, you are saying that you are certain that the key belongs to the
1170 person it says it comes from. You should be very sure that is really
1171 that person: You should verify the key fingerprint with:
1174 $ gpg --fingerprint KeyID
1177 over the phone (if you really know the voice of the other person), at
1178 a key signing party (which are often held at computer conferences),
1179 or at a meeting of your local GNU/Linux User Group.
1181 Hmm, what else. You may use the option '-o filename' to force output
1182 to this filename (use '-' to force output to stdout). '-r' just lets
1183 you specify the recipient (which public key you encrypt with) on the
1184 command line instead of typing it interactively.
1186 Oh yeah, this is important. By default all data is encrypted in some
1187 weird binary format. If you want to have things appear in ASCII text
1188 that is readable, just add the '-a' option. But the preferred method
1189 is to use a MIME aware mail reader (Mutt, Pine and many more).
1191 There is a small security glitch in the OpenPGP (and therefore GnuPG)
1192 system; to avoid this you should always sign and encrypt a message
1193 instead of only encrypting it.
1195 <Q> Why are some signatures with an ELG-E key valid?
1197 These are Elgamal keys generated by GnuPG in v3 (RFC 1991) packets.
1198 The OpenPGP draft later changed the algorithm identifier for Elgamal
1199 keys which are usable for signatures and encryption from 16 to 20.
1200 GnuPG now uses 20 when it generates new Elgamal keys but still
1201 accepts 16 (which is according to OpenPGP "encryption only") if this
1202 key is in a v3 packet. GnuPG is the only program which had used
1203 these v3 Elgamal keys - so this assumption is quite safe.
1205 <Q> How does the whole trust thing work?
1207 It works more or less like PGP. The difference is that the trust is
1208 computed at the time it is needed. This is one of the reasons for
1209 the trustdb which holds a list of valid key signatures. If you are
1210 not running in batch mode you will be asked to assign a trust
1211 parameter (ownertrust) to a key.
1213 You can see the validity (calculated trust value) using this
1217 $ gpg --list-keys --with-colons
1220 If the first field is "pub" or "uid", the second field shows you the
1224 o = Unknown (this key is new to the system)
1225 e = The key has expired
1226 q = Undefined (no value assigned)
1227 n = Don't trust this key at all
1228 m = There is marginal trust in this key
1229 f = The key is full trusted
1230 u = The key is ultimately trusted; this is only used
1231 for keys for which the secret key is also available.
1232 r = The key has been revoked
1233 d = The key has been disabled
1236 The value in the "pub" record is the best one of all "uid" records.
1237 You can get a list of the assigned trust values (how much you trust
1238 the owner to correctly sign another person's key) with:
1241 $ gpg --list-ownertrust
1244 The first field is the fingerprint of the primary key, the second
1245 field is the assigned value:
1248 - = No ownertrust value yet assigned or calculated.
1249 n = Never trust this keyholder to correctly verify others signatures.
1250 m = Have marginal trust in the keyholders capability to sign other
1252 f = Assume that the key holder really knows how to sign keys.
1253 u = No need to trust ourself because we have the secret key.
1256 Keep these values confidential because they express your opinions
1257 about others. PGP stores this information with the keyring thus it
1258 is not a good idea to publish a PGP keyring instead of exporting the
1259 keyring. GnuPG stores the trust in the trustdb.gpg file so it is okay
1260 to give a gpg keyring away (but we have a --export command too).
1262 <Q> What kind of output is this: "key C26EE891.298, uid 09FB: ...."?
1264 This is the internal representation of a user ID in the trustdb.
1265 "C26EE891" is the keyid, "298" is the local ID (a record number in
1266 the trustdb) and "09FB" is the last two bytes of a ripe-md-160 hash
1267 of the user ID for this key.
1269 <Q> How do I interpret some of the informational outputs?
1271 While checking the validity of a key, GnuPG sometimes prints some
1272 information which is prefixed with information about the checked
1279 This is about the key with key ID 12345678 and the internal number
1280 3456, which is the record number of the so called directory record
1284 "uid 12345678.3456/ACDE"
1287 This is about the user ID for the same key. To identify the user ID
1288 the last two bytes of a ripe-md-160 over the user ID ring is printed.
1291 "sig 12345678.3456/ACDE/9A8B7C6D"
1294 This is about the signature with key ID 9A8B7C6D for the above key
1295 and user ID, if it is a signature which is direct on a key, the user
1296 ID part is empty (..//..).
1298 <Q> Are the header lines of a cleartext signature part of the signed
1301 No. For example you can add or remove "Comment:" lines. They have
1302 a purpose like the mail header lines. However a "Hash:" line is
1303 needed for OpenPGP signatures to tell the parser which hash
1306 <Q> What is the list of preferred algorithms?
1308 The list of preferred algorithms is a list of cipher, hash and
1309 compression algorithms stored in the self-signature of a key during
1310 key generation. When you encrypt a document, GnuPG uses this list
1311 (which is then part of a public key) to determine which algorithms
1312 to use. Basically it tells other people what algorithms the
1313 recipient is able to handle and provides an order of preference.
1315 <Q> How do I change the list of preferred algorithms?
1317 In version 1.0.7 or later, you can use the edit menu and set the
1318 new list of preference using the command "setpref"; the format of
1319 this command resembles the output of the command "pref". The
1320 preference is not changed immediately but the set preference will
1321 be used when a new user ID is created. If you want to update the
1322 preferences for existing user IDs, select those user IDs (or select
1323 none to update all) and enter the command "updpref". Note that the
1324 timestamp of the self-signature is increased by one second when
1325 running this command.
1328 <S> ACKNOWLEDGEMENTS
1330 Many thanks to Nils Ellmenreich for maintaining this FAQ file for
1331 such a long time, Werner Koch for the original FAQ file, and to all
1332 posters to gnupg-users and gnupg-devel. They all provided most of
1335 Also thanks to Casper Dik for providing us with a script to generate
1336 this FAQ (he uses it for the excellent Solaris2 FAQ).
1340 Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.,
1341 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
1343 Verbatim copying and distribution of this entire article is permitted in
1344 any medium, provided this notice is preserved.