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 it is name "gnupg" and
587 found below the user's application directory. Run the gpg and
588 pass the option --version to see the name of that directory.
590 If you want to put your keyrings somewhere else, use the option:
596 to make GnuPG create all its files in that directory. Your keyring
597 will be "/my/path/pubring.gpg". This way you can store your secrets
598 on a floppy disk. Don't use "--keyring" as its purpose is to specify
599 additional keyring files.
601 <Q> How do I verify signed packages?
603 Before you can verify the signature that accompanies a package,
604 you must first have the vendor, organisation, or issueing person's
605 key imported into your public keyring. To prevent GnuPG warning
606 messages the key should also be validated (or locally signed).
608 You will also need to download the detached signature file along
609 with the package. These files will usually have the same name as
610 the package, with either a binary (.sig) or ASCII armor (.asc)
613 Once their key has been imported, and the package and accompanying
614 signature files have been downloaded, use:
617 $ gpg --verify sigfile signed-file
620 If the signature file has the same base name as the package file,
621 the package can also be verified by specifying just the signature
622 file, as GnuPG will derive the package's file name from the name
623 given (less the .sig or .asc extension). For example, to verify a
624 package named foobar.tar.gz against its detached binary signature
628 $ gpg --verify foobar.tar.gz.sig
631 <Q> How do I export a keyring with only selected signatures (keys)?
633 If you're wanting to create a keyring with only a subset of keys
634 selected from a master keyring (for a club, user group, or company
635 department for example), simply specify the keys you want to export:
638 $ gpg --armor --export key1 key2 key3 key4 > keys1-4.asc
642 <Q> I still have my secret key, but lost my public key. What can I do?
644 All OpenPGP secret keys have a copy of the public key inside them,
645 and in a worst-case scenario, you can create yourself a new public
646 key using the secret key.
648 A tool to convert a secret key into a public one has been included
649 (it's actually a new option for gpgsplit) and is available with GnuPG
650 versions 1.2.1 or later (or can be found in CVS). It works like this:
653 $ gpgsplit --no-split --secret-to-public secret.gpg >publickey.gpg
656 One should first try to export the secret key and convert just this
657 one. Using the entire secret keyring should work too. After this has
658 been done, the publickey.gpg file can be imported into GnuPG as usual.
660 <Q> Clearsigned messages sent from my web-mail account have an invalid
663 Check to make sure the settings for your web-based email account
664 do not use HTML formatting for the pasted clearsigned message. This can
665 alter the message with embedded HTML markup tags or spaces, resulting
666 in an invalid signature. The recipient may be able to copy the signed
667 message block to a text file for verification, or the web email
668 service may allow you to attach the clearsigned message as a file
669 if plaintext messages are not an option.
672 <S> COMPATIBILITY ISSUES
675 <Q> How can I encrypt a message with GnuPG so that PGP is able to decrypt it?
677 It depends on the PGP version.
681 You can't do that because PGP 2.x normally uses IDEA which is not
682 supported by GnuPG as it is patented (see <Ridea>), but if you have a
683 modified version of PGP you can try this:
686 $ gpg --rfc1991 --cipher-algo 3des ...
689 Please don't pipe the data to encrypt to gpg but provide it using a
690 filename; otherwise, PGP 2 will not be able to handle it.
692 As for conventional encryption, you can't do this for PGP 2.
694 [H li]PGP 5.x and higher[H br]
695 You need to provide two additional options:
698 --compress-algo 1 --cipher-algo cast5
701 You may also use "3des" instead of "cast5", and "blowfish" does not
702 work with all versions of PGP 5. You may also want to put:
708 into your ~/.gnupg/options file - this does not affect normal GnuPG
711 This applies to conventional encryption as well.
714 <Q> How do I migrate from PGP 2.x to GnuPG?
716 PGP 2 uses the RSA and IDEA encryption algorithms. Whereas the RSA
717 patent has expired and RSA is included as of GnuPG 1.0.3, the IDEA
718 algorithm is still patented until 2007. Under certain conditions you
719 may use IDEA even today. In that case, you may refer to Question
720 <Ridea> about how to add IDEA support to GnuPG and read
721 [H a href=[$hGPGHTTP]/gph/en/pgp2x.html]<[$hGPGHTTP]/gph/en/pgp2x.html>[H /a] to perform the migration.
727 <Q> Why is PGP 5.x not able to encrypt messages with some keys?
729 PGP, Inc. refuses to accept Elgamal keys of type 20 even for
730 encryption. They only support type 16 (which is identical at least
731 for decryption). To be more inter-operable, GnuPG (starting with
732 version 0.3.3) now also uses type 16 for the Elgamal subkey which is
733 created if the default key algorithm is chosen. You may add a type
734 16 Elgamal key to your public key, which is easy as your key
735 signatures are still valid.
737 <Q> Why is PGP 5.x not able to verify my messages?
739 PGP 5.x does not accept v4 signatures for data material but OpenPGP
740 requests generation of v4 signatures for all kind of data, that's why
741 GnuPG defaults to them. Use the option "--force-v3-sigs" to generate
742 v3 signatures for data.
744 <Q> How do I transfer owner trust values from PGP to GnuPG?
746 There is a script in the tools directory to help you. After you have
747 imported the PGP keyring you can give this command:
750 $ lspgpot pgpkeyring | gpg --import-ownertrust
753 where pgpkeyring is the original keyring and not the GnuPG keyring
754 you might have created in the first step.
756 <Q> PGP does not like my secret key.
758 Older PGPs probably bail out on some private comment packets used by
759 GnuPG. These packets are fully in compliance with OpenPGP; however
760 PGP is not really OpenPGP aware. A workaround is to export the
761 secret keys with this command:
764 $ gpg --export-secret-keys --no-comment -a your-KeyID
767 Another possibility is this: by default, GnuPG encrypts your secret
768 key using the Blowfish symmetric algorithm. Older PGPs will only
769 understand 3DES, CAST5, or IDEA symmetric algorithms. Using the
770 following method you can re-encrypt your secret gpg key with a
774 $ gpg --s2k-cipher-algo=CAST5 --s2k-digest-algo=SHA1
775 --compress-algo=1 --edit-key <username>
778 Then use passwd to change the password (just change it to the same
779 thing, but it will encrypt the key with CAST5 this time).
781 Now you can export it and PGP should be able to handle it.
783 For PGP 6.x the following options work to export a key:
786 $ gpg --s2k-cipher-algo 3des --compress-algo 1 --rfc1991
787 --export-secret-keys <KeyID>
791 <Q> GnuPG no longer installs a ~/.gnupg/options file. Is it missing?
793 No. The ~/.gnupg/options file has been renamed to ~/.gnupg/gpg.conf for
794 new installs as of version 1.1.92. If an existing ~/.gnupg/options file
795 is found during an upgrade it will still be used, but this change was
796 required to have a more consistent naming scheme with forthcoming tools.
797 An existing options file can be renamed to gpg.conf for users upgrading,
798 or receiving the message that the "old default options file" is ignored
799 (occurs if both a gpg.conf and an options file are found).
801 <Q> How do you export GnuPG keys for use with PGP?
803 This has come up fairly often, so here's the HOWTO:
805 PGP can (for most key types) use secret keys generated by GnuPG. The
806 problems that come up occasionally are generally because GnuPG
807 supports a few more features from the OpenPGP standard than PGP does.
808 If your secret key has any of those features in use, then PGP will
809 reject the key or you will have problems communicating later. Note
810 that PGP doesn't do Elgamal signing keys at all, so they are not
811 usable with any version.
813 These instructions should work for GnuPG 1.0.7 and later, and PGP
816 Start by editing the key. Most of this line is not really necessary
817 as the default values are correct, but it does not hurt to repeat the
818 values, as this will override them in case you have something else set
819 in your options file.
822 $ gpg --s2k-cipher-algo cast5 --s2k-digest-algo sha1 --s2k-mode 3
823 --simple-sk-checksum --edit KeyID
826 Turn off some features. Set the list of preferred ciphers, hashes,
827 and compression algorithms to things that PGP can handle. (Yes, I
828 know this is an odd list of ciphers, but this is what PGP itself uses,
832 > setpref S9 S8 S7 S3 S2 S10 H2 H3 Z1 Z0
835 Now put the list of preferences onto the key.
841 Finally we must decrypt and re-encrypt the key, making sure that we
842 encrypt with a cipher that PGP likes. We set this up in the --edit
843 line above, so now we just need to change the passphrase to make it
844 take effect. You can use the same passphrase if you like, or take
845 this opportunity to actually change it.
857 Now we can do the usual export:
860 $ gpg --export KeyID > mypublickey.pgp[H br]
861 $ gpg --export-secret-key KeyID > mysecretkey.pgp
864 Thanks to David Shaw for this information!
867 <S> PROBLEMS and ERROR MESSAGES
869 <Q> Why do I get "gpg: Warning: using insecure memory!"
871 On many systems this program should be installed as setuid(root).
872 This is necessary to lock memory pages. Locking memory pages prevents
873 the operating system from writing them to disk and thereby keeping your
874 secret keys really secret. If you get no warning message about insecure
875 memory your operating system supports locking without being root. The
876 program drops root privileges as soon as locked memory is allocated.
878 To setuid(root) permissions on the gpg binary you can either use:
881 $ chmod u+s /path/to/gpg
887 $ chmod 4755 /path/to/gpg
890 Some refrain from using setuid(root) unless absolutely required for
891 security reasons. Please check with your system administrator if you
892 are not able to make these determinations yourself.
894 On UnixWare 2.x and 7.x you should install GnuPG with the 'plock'
895 privilege to get the same effect:
898 $ filepriv -f plock /path/to/gpg
901 If you can't or don't want to install GnuPG setuid(root), you can
902 use the option "--no-secmem-warning" or put:
908 in your ~/.gnupg/options or ~/.gnupg/gpg.conf file (this disables
911 On some systems (e.g., Windows) GnuPG does not lock memory pages
912 and older GnuPG versions (<=1.0.4) issue the warning:
915 gpg: Please note that you don't have secure memory
918 This warning can't be switched off by the above option because it
919 was thought to be too serious an issue. However, it confused users
920 too much, so the warning was eventually removed.
922 <Q> Large File Support doesn't work ...
924 LFS works correctly in post-1.0.4 versions. If configure doesn't
925 detect it, try a different (i.e., better) compiler. egcs 1.1.2 works
926 fine, other gccs sometimes don't. BTW, several compilation problems
927 of GnuPG 1.0.3 and 1.0.4 on HP-UX and Solaris were due to broken LFS
930 <Q> In the edit menu the trust values are not displayed correctly after
933 This happens because some information is stored immediately in
934 the trustdb, but the actual trust calculation can be done after the
935 save command. This is a "not easy to fix" design bug which will be
936 addressed in some future release.
938 <Q> What does "skipping pubkey 1: already loaded" mean?
940 As of GnuPG 1.0.3, the RSA algorithm is included. If you still have
941 a "load-extension rsa" in your options file, the above message
942 occurs. Just remove the load command from the options file.
944 <Q> GnuPG 1.0.4 doesn't create ~/.gnupg ...
946 That's a known bug, already fixed in newer versions.
948 <Q> An Elgamal signature does not verify anymore since version 1.0.2 ...
950 Use the option --emulate-md-encode-bug.
952 <Q> Old versions of GnuPG can't verify Elgamal signatures
954 Update to GnuPG 1.0.2 or newer.
956 <Q> When I use --clearsign, the plain text has sometimes extra dashes
959 This is called dash-escaped text and is required by OpenPGP.
960 It always happens when a line starts with a dash ("-") and is
961 needed to make the lines that structure signature and text
962 (i.e., "-----BEGIN PGP SIGNATURE-----") to be the only lines
963 that start with two dashes.
965 If you use GnuPG to process those messages, the extra dashes
966 are removed. Good mail clients remove those extra dashes when
967 displaying such a message.
969 <Q> What is the thing with "can't handle multiple signatures"?
971 Due to different message formats GnuPG is not always able to split
972 a file with multiple signatures unambiguously into its parts. This
973 error message informs you that there is something wrong with the input.
975 The only way to have multiple signatures in a file is by using the
976 OpenPGP format with one-pass-signature packets (which is GnuPG's
977 default) or the cleartext signed format.
979 <Q> If I submit a key to a keyserver, nothing happens ...
981 You are most likely using GnuPG 1.0.2 or older on Windows. That's
982 feature isn't yet implemented, but it's a bug not to say it. Newer
983 versions issue a warning. Upgrade to 1.4.5 or newer.
985 <Q> I get "gpg: waiting for lock ..."
987 A previous instance of gpg has most likely exited abnormally and left
988 a lock file. Go to ~/.gnupg and look for .*.lock files and remove them.
990 <Q> Older gpg binaries (e.g., 1.0) have problems with keys from newer
993 As of 1.0.3, keys generated with gpg are created with preferences to
994 TWOFISH (and AES since 1.0.4) and that also means that they have the
995 capability to use the new MDC encryption method. This will go into
996 OpenPGP soon, and is also suppoted by PGP 7. This new method avoids
997 a (not so new) attack on all email encryption systems.
999 This in turn means that pre-1.0.3 gpg binaries have problems with
1000 newer keys. Because of security and bug fixes, you should keep your
1001 GnuPG installation in a recent state anyway. As a workaround, you can
1002 force gpg to use a previous default cipher algo by putting:
1008 into your options file.
1010 <Q> With 1.0.4, I get "this cipher algorithm is deprecated ..."
1012 If you just generated a new key and get this message while
1013 encrypting, you've witnessed a bug in 1.0.4. It uses the new AES
1014 cipher Rijndael that is incorrectly being referred as "deprecated".
1015 Ignore this warning, more recent versions of gpg are corrected.
1017 <Q> Some dates are displayed as ????-??-??. Why?
1019 Due to constraints in most libc implementations, dates beyond
1020 2038-01-19 can't be displayed correctly. 64-bit OSes are not
1021 affected by this problem. To avoid printing wrong dates, GnuPG
1022 instead prints some question marks. To see the correct value, you
1023 can use the options --with-colons and --fixed-list-mode.
1025 <Q> I still have a problem. How do I report a bug?
1027 Are you sure that it's not been mentioned somewhere on the mailing
1028 lists? Did you have a look at the bug list (you'll find a link to
1029 the list of reported bugs on the documentation page). If you're not
1030 sure about it being a bug, you can send mail to the gnupg-devel
1031 list. Otherwise, use the bug tracking system
1032 [H a href=http://bugs.gnupg.org]<http://bugs.gnupg.org>[H /a].
1034 <Q> Why doesn't GnuPG support X.509 certificates?
1036 GnuPG, first and foremost, is an implementation of the OpenPGP
1037 standard (RFC 2440), which is a competing infrastructure, different
1040 They are both public-key cryptosystems, but how the public keys are
1041 actually handled is different.
1043 <Q> Why do national characters in my user ID look funny?
1045 According to OpenPGP, GnuPG encodes user ID strings (and other
1046 things) using UTF-8. In this encoding of Unicode, most national
1047 characters get encoded as two- or three-byte sequences. For
1048 example, å (0xE5 in ISO-8859-1) becomes Ã¥ (0xC3,
1049 0xA5). This might also be the reason why keyservers can't find
1052 <Q> I get 'sed' errors when running ./configure on Mac OS X ...
1054 This will be fixed after GnuPG has been upgraded to autoconf-2.50.
1055 Until then, find the line setting CDPATH in the configure script
1064 <Q> Why does GnuPG 1.0.6 bail out on keyrings used with 1.0.7?
1066 There is a small bug in 1.0.6 which didn't parse trust packets
1067 correctly. You may want to apply this patch if you can't upgrade:
1069 [H a href=http://www.gnupg.org/developer/gpg-woody-fix.txt]<http://www.gnupg.org/developer/gpg-woody-fix.txt>[H /a]
1071 <Q> I upgraded to GnuPG version 1.0.7 and now it takes longer to load my
1072 keyrings. What can I do?
1074 The way signature states are stored has changed so that v3 signatures
1075 can be supported. You can use the new --rebuild-keydb-caches migration
1076 command, which was built into this release and increases the speed of
1077 many operations for existing keyrings.
1079 <Q> Doesn't a fully trusted user ID on a key prevent warning messages
1080 when encrypting to other IDs on the key?
1082 No. That was actually a key validity bug in GnuPG 1.2.1 and earlier
1083 versions. As part of the development of GnuPG 1.2.2, a bug was
1084 discovered in the key validation code. This bug causes keys with
1085 more than one user ID to give all user IDs on the key the amount of
1086 validity given to the most-valid key. The bug has been fixed in GnuPG
1087 release 1.2.2, and upgrading is the recommended fix for this problem.
1088 More information and a patch for a some pre-1.2.2 versions of GnuPG
1091 [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]
1093 <Q> I just compiled GnuPG from source on my GNU/Linux RPM-based system
1094 and it's not working. Why?
1096 Many GNU/Linux distributions that are RPM-based will install a
1097 version of GnuPG as part of its standard installation, placing the
1098 binaries in the /usr/bin directory. Later, compiling and installing
1099 GnuPG from source other than from a source RPM won't normally
1100 overwrite these files, as the default location for placement of
1101 GnuPG binaries is in /usr/local/bin unless the '--prefix' switch
1102 is used during compile to specify an alternate location. Since the
1103 /usr/bin directory more than likely appears in your path before
1104 /usr/local/bin, the older RPM-version binaries will continue to
1105 be used when called since they were not replaced.
1107 To resolve this, uninstall the RPM-based version with 'rpm -e gnupg'
1108 before installing the binaries compiled from source. If dependency
1109 errors are displayed when attempting to uninstall the RPM (such as
1110 when Red Hat's up2date is also installed, which uses GnuPG), uninstall
1111 the RPM with 'rpm -e gnupg --nodeps' to force the uninstall. Any
1112 dependent files should be automatically replaced during the install
1113 of the compiled version. If the default /usr/local/bin directory is
1114 used, some packages such as SuSE's Yast Online Update may need to be
1115 configured to look for GnuPG binaries in the /usr/local/bin directory,
1116 or symlinks can be created in /usr/bin that point to the binaries
1117 located in /usr/local/bin.
1122 <Q> How does this whole thing work?
1124 To generate a secret/public keypair, run:
1130 and choose the default values.
1132 Data that is encrypted with a public key can only be decrypted by
1133 the matching secret key. The secret key is protected by a password,
1134 the public key is not.
1136 So to send your friend a message, you would encrypt your message
1137 with his public key, and he would only be able to decrypt it by
1138 having the secret key and putting in the password to use his secret
1141 GnuPG is also useful for signing things. Files that are encrypted
1142 with the secret key can be decrypted with the public key. To sign
1143 something, a hash is taken of the data, and then the hash is in some
1144 form encoded with the secret key. If someone has your public key, they
1145 can verify that it is from you and that it hasn't changed by checking
1146 the encoded form of the hash with the public key.
1148 A keyring is just a large file that stores keys. You have a public
1149 keyring where you store yours and your friend's public keys. You have
1150 a secret keyring that you keep your secret key on, and should be very
1151 careful with. Never ever give anyone else access to it and use a *good*
1152 passphrase to protect the data in it.
1154 You can 'conventionally' encrypt something by using the option 'gpg -c'.
1155 It is encrypted using a passphrase, and does not use public and secret
1156 keys. If the person you send the data to knows that passphrase, they
1157 can decrypt it. This is usually most useful for encrypting things to
1158 yourself, although you can encrypt things to your own public key in the
1159 same way. It should be used for communication with partners you know
1160 and where it is easy to exchange the passphrases (e.g. with your boy
1161 friend or your wife). The advantage is that you can change the
1162 passphrase from time to time and decrease the risk, that many old
1163 messages may be decrypted by people who accidently got your passphrase.
1165 You can add and copy keys to and from your keyring with the 'gpg
1166 --import' and 'gpg --export' command. 'gpg --export-secret-keys' will
1167 export secret keys. This is normally not useful, but you can generate
1168 the key on one machine then move it to another machine.
1170 Keys can be signed under the 'gpg --edit-key' option. When you sign a
1171 key, you are saying that you are certain that the key belongs to the
1172 person it says it comes from. You should be very sure that is really
1173 that person: You should verify the key fingerprint with:
1176 $ gpg --fingerprint KeyID
1179 over the phone (if you really know the voice of the other person), at
1180 a key signing party (which are often held at computer conferences),
1181 or at a meeting of your local GNU/Linux User Group.
1183 Hmm, what else. You may use the option '-o filename' to force output
1184 to this filename (use '-' to force output to stdout). '-r' just lets
1185 you specify the recipient (which public key you encrypt with) on the
1186 command line instead of typing it interactively.
1188 Oh yeah, this is important. By default all data is encrypted in some
1189 weird binary format. If you want to have things appear in ASCII text
1190 that is readable, just add the '-a' option. But the preferred method
1191 is to use a MIME aware mail reader (Mutt, Pine and many more).
1193 There is a small security glitch in the OpenPGP (and therefore GnuPG)
1194 system; to avoid this you should always sign and encrypt a message
1195 instead of only encrypting it.
1197 <Q> Why are some signatures with an ELG-E key valid?
1199 These are Elgamal keys generated by GnuPG in v3 (RFC 1991) packets.
1200 The OpenPGP draft later changed the algorithm identifier for Elgamal
1201 keys which are usable for signatures and encryption from 16 to 20.
1202 GnuPG now uses 20 when it generates new Elgamal keys but still
1203 accepts 16 (which is according to OpenPGP "encryption only") if this
1204 key is in a v3 packet. GnuPG is the only program which had used
1205 these v3 Elgamal keys - so this assumption is quite safe.
1207 <Q> How does the whole trust thing work?
1209 It works more or less like PGP. The difference is that the trust is
1210 computed at the time it is needed. This is one of the reasons for
1211 the trustdb which holds a list of valid key signatures. If you are
1212 not running in batch mode you will be asked to assign a trust
1213 parameter (ownertrust) to a key.
1215 You can see the validity (calculated trust value) using this
1219 $ gpg --list-keys --with-colons
1222 If the first field is "pub" or "uid", the second field shows you the
1226 o = Unknown (this key is new to the system)
1227 e = The key has expired
1228 q = Undefined (no value assigned)
1229 n = Don't trust this key at all
1230 m = There is marginal trust in this key
1231 f = The key is full trusted
1232 u = The key is ultimately trusted; this is only used
1233 for keys for which the secret key is also available.
1234 r = The key has been revoked
1235 d = The key has been disabled
1238 The value in the "pub" record is the best one of all "uid" records.
1239 You can get a list of the assigned trust values (how much you trust
1240 the owner to correctly sign another person's key) with:
1243 $ gpg --list-ownertrust
1246 The first field is the fingerprint of the primary key, the second
1247 field is the assigned value:
1250 - = No ownertrust value yet assigned or calculated.
1251 n = Never trust this keyholder to correctly verify others signatures.
1252 m = Have marginal trust in the keyholders capability to sign other
1254 f = Assume that the key holder really knows how to sign keys.
1255 u = No need to trust ourself because we have the secret key.
1258 Keep these values confidential because they express your opinions
1259 about others. PGP stores this information with the keyring thus it
1260 is not a good idea to publish a PGP keyring instead of exporting the
1261 keyring. GnuPG stores the trust in the trustdb.gpg file so it is okay
1262 to give a gpg keyring away (but we have a --export command too).
1264 <Q> What kind of output is this: "key C26EE891.298, uid 09FB: ...."?
1266 This is the internal representation of a user ID in the trustdb.
1267 "C26EE891" is the keyid, "298" is the local ID (a record number in
1268 the trustdb) and "09FB" is the last two bytes of a ripe-md-160 hash
1269 of the user ID for this key.
1271 <Q> How do I interpret some of the informational outputs?
1273 While checking the validity of a key, GnuPG sometimes prints some
1274 information which is prefixed with information about the checked
1281 This is about the key with key ID 12345678 and the internal number
1282 3456, which is the record number of the so called directory record
1286 "uid 12345678.3456/ACDE"
1289 This is about the user ID for the same key. To identify the user ID
1290 the last two bytes of a ripe-md-160 over the user ID ring is printed.
1293 "sig 12345678.3456/ACDE/9A8B7C6D"
1296 This is about the signature with key ID 9A8B7C6D for the above key
1297 and user ID, if it is a signature which is direct on a key, the user
1298 ID part is empty (..//..).
1300 <Q> Are the header lines of a cleartext signature part of the signed
1303 No. For example you can add or remove "Comment:" lines. They have
1304 a purpose like the mail header lines. However a "Hash:" line is
1305 needed for OpenPGP signatures to tell the parser which hash
1308 <Q> What is the list of preferred algorithms?
1310 The list of preferred algorithms is a list of cipher, hash and
1311 compression algorithms stored in the self-signature of a key during
1312 key generation. When you encrypt a document, GnuPG uses this list
1313 (which is then part of a public key) to determine which algorithms
1314 to use. Basically it tells other people what algorithms the
1315 recipient is able to handle and provides an order of preference.
1317 <Q> How do I change the list of preferred algorithms?
1319 In version 1.0.7 or later, you can use the edit menu and set the
1320 new list of preference using the command "setpref"; the format of
1321 this command resembles the output of the command "pref". The
1322 preference is not changed immediately but the set preference will
1323 be used when a new user ID is created. If you want to update the
1324 preferences for existing user IDs, select those user IDs (or select
1325 none to update all) and enter the command "updpref". Note that the
1326 timestamp of the self-signature is increased by one second when
1327 running this command.
1329 <Q> How can I import all the missing signer keys?
1331 If you imported a key and you want to also import all the signer's
1332 keys, you can do this with this command:
1334 gpg --check-sigs --with-colon KEYID \
1335 | awk -F: '$1 == "sig" && $2 == "?" { print $5 }' \
1336 | sort | uniq | xargs echo gpg --recv-keys
1338 Note that the invocation of sort is also required to wait for the
1339 of the listing before before starting the import.
1342 <S> ACKNOWLEDGEMENTS
1344 Many thanks to Nils Ellmenreich for maintaining this FAQ file for
1345 such a long time, Werner Koch for the original FAQ file, and to all
1346 posters to gnupg-users and gnupg-devel. They all provided most of
1349 Also thanks to Casper Dik for providing us with a script to generate
1350 this FAQ (he uses it for the excellent Solaris2 FAQ).
1354 Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.,
1355 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
1357 Verbatim copying and distribution of this entire article is permitted in
1358 any medium, provided this notice is preserved.