2 GnuPG - The GNU Privacy Guard
3 -------------------------------
6 Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
8 This file is free software; as a special exception the author gives
9 unlimited permission to copy and/or distribute it, with or without
10 modifications, as long as this notice is preserved.
12 This file is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
14 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 GnuPG is GNU's tool for secure communication and data storage.
21 It can be used to encrypt data and to create digital signatures.
22 It includes an advanced key management facility and is compliant
23 with the proposed OpenPGP Internet standard as described in RFC2440.
25 GnuPG works best on GNU/Linux or *BSD systems. Most other Unices
26 are also supported but are not as well tested as the Free Unices.
27 See http://www.gnupg.org/gnupg.html#supsys for a list of systems
28 which are known to work.
30 See the file COPYING for copyright and warranty information.
32 Because GnuPG does not use use any patented algorithm it cannot be
33 compatible with PGP2 versions. PGP 2.x uses IDEA (which is patented
36 The default algorithms are DSA and ElGamal. ElGamal for signing
37 is still available, but because of the larger size of such
38 signatures it is deprecated (Please note that the GnuPG
39 implementation of ElGamal signatures is *not* insecure). Symmetric
40 algorithms are: AES, 3DES, Blowfish, CAST5 and Twofish
41 Digest algorithms available are MD5, RIPEMD160 and SHA1.
46 Please read the file INSTALL and the sections in this file
47 related to the installation. Here is a quick summary:
49 1) Check that you have unmodified sources. The below on how
50 to do this. Don't skip it - this is an important step!
52 2) Unpack the TAR. With GNU tar you can do it this way:
53 "tar xzvf gnupg-x.y.z.tar.gz"
63 7) You end up with a "gpg" binary in /usr/local/bin.
65 8) To avoid swapping out of sensitive data, you can install "gpg" as
66 suid root. If you don't do so, you may want to add the option
67 "no-secmem-warning" to ~/.gnupg/gpg.conf
70 How to Verify the Source
71 ------------------------
72 In order to check that the version of GnuPG which you are going to
73 install is an original and unmodified one, you can do it in one of
76 a) If you already have a trusted Version of GnuPG installed, you
77 can simply check the supplied signature:
79 $ gpg --verify gnupg-x.y.z.tar.gz.asc
81 This checks that the detached signature gnupg-x.y.z.tar.gz.asc
82 is indeed a a signature of gnupg-x.y.z.tar.gz. The key used to
83 create this signature is:
85 "pub 1024D/57548DCD 1998-07-07 Werner Koch (gnupg sig) <dd9jn@gnu.org>"
87 If you do not have this key, you can get it from the source in
88 the file doc/samplekeys.asc (use "gpg --import doc/samplekeys.asc"
89 to add it to the keyring) or from any keyserver. You have to
90 make sure that this is really the key and not a faked one. You
91 can do this by comparing the output of:
93 $ gpg --fingerprint 0x57548DCD
95 with the elsewhere published fingerprint
97 Please note, that you have to use an old version of GnuPG to
98 do all this stuff. *Never* use the version which you are going
102 b) If you don't have any of the above programs, you have to verify
105 $ md5sum gnupg-x.y.z.tar.gz
107 This should yield an output _similar_ to this:
109 fd9351b26b3189c1d577f0970f9dcadc gnupg-x.y.z.tar.gz
111 Now check that this checksum is _exactly_ the same as the one
112 published via the announcement list and probably via Usenet.
118 The manual will be distributed separate under the name "gph".
119 An online version of the latest manual draft is available at the
122 http://www.gnupg.org/gph/
124 A list of frequently asked questions is available in GnuPG's
125 distibution in the file doc/FAQ and online as:
127 http://www.gnupg.org/faq.html
129 A couple of HOWTO documents are available online; for a listing see:
131 http://www.gnupg.org/docs.html#howtos
133 A man page with a description of all commands and options gets installed
134 along with the program.
139 Here is a brief overview on how to use GnuPG - it is strongly suggested
140 that you read the manual and other information about the use of
141 cryptography. GnuPG is only a tool, secure usage requires that
142 YOU KNOW WHAT YOU ARE DOING.
144 If you already have a DSA key from PGP 5 (they call them DH/ElGamal)
145 you can simply copy the pgp keyrings over the GnuPG keyrings after
146 running gpg once to create the correct directory.
148 The normal way to create a key is
152 This asks some questions and then starts key generation. To create
153 good random numbers for the key parameters, GnuPG needs to gather
154 enough noise (entropy) from your system. If you see no progress
155 during key generation you should start some other activities such
156 as mouse moves or hitting on the CTRL and SHIFT keys.
158 Generate a key ONLY on a machine where you have direct physical
159 access - don't do it over the network or on a machine used also
160 by others - especially if you have no access to the root account.
162 When you are asked for a passphrase use a good one which you can
163 easy remember. Don't make the passphrase too long because you have
164 to type it for every decryption or signing; but, - AND THIS IS VERY
165 IMPORTANT - use a good one that is not easily to guess because the
166 security of the whole system relies on your secret key and the
167 passphrase that protects it when someone gains access to your secret
168 keyring. A good way to select a passphrase is to figure out a short
169 nonsense sentence which makes some sense for you and modify it by
170 inserting extra spaces, non-letters and changing the case of some
171 characters - this is really easy to remember especially if you
172 associate some pictures with it.
174 Next, you should create a revocation certificate in case someone
175 gets knowledge of your secret key or you forgot your passphrase
177 gpg --gen-revoke your_user_id
179 Run this command and store the revocation certificate away. The output
180 is always ASCII armored, so that you can print it and (hopefully
181 never) re-create it if your electronic media fails.
183 Now you can use your key to create digital signatures
187 This creates a file "file.gpg" which is compressed and has a
192 Same as above, but creates a file "file.asc" which is ASCII armored
193 and and ready for sending by mail. It is better to use your
194 mailers features to create signatures (The mailer uses GnuPG to do
195 this) because the mailer has the ability to MIME encode such
196 signatures - but this is not a security issue.
200 Creates a signature of "file", but writes the output to the file
203 Everyone who knows your public key (you can and should publish
204 your key by putting it on a key server, a web page or in your .plan
205 file) is now able to check whether you really signed this text
209 GnuPG now checks whether the signature is valid and prints an
210 appropriate message. If the signature is good, you know at least
211 that the person (or machine) has access to the secret key which
212 corresponds to the published public key.
214 If you run gpg without an option it will verify the signature and
215 create a new file that is identical to the original. gpg can also
216 run as a filter, so that you can pipe data to verify trough it
218 cat signed-file | gpg | wc -l
220 which will check the signature of signed-file and then display the
221 number of lines in the original file.
223 To send a message encrypted to someone you can use
227 This encrypts "file" with the public key of the user "heine" and
228 writes it to "file.gpg"
230 echo "hello" | gpg -ea -r heine | mail heine
232 Ditto, but encrypts "hello\n" and mails it as ASCII armored message
233 to the user with the mail address heine.
235 gpg -se -r heine file
237 This encrypts "file" with the public key of "heine" and writes it
238 to "file.gpg" after signing it with your user id.
240 gpg -se -r heine -u Suttner file
242 Ditto, but sign the file with your alternative user id "Suttner"
245 GnuPG has some options to help you publish public keys. This is
246 called "exporting" a key, thus
248 gpg --export >all-my-keys
250 exports all the keys in the keyring and writes them (in a binary
251 format) to "all-my-keys". You may then mail "all-my-keys" as an
252 MIME attachment to someone else or put it on an FTP server. To
253 export only some user IDs, you give them as arguments on the command
256 To mail a public key or put it on a web page you have to create
257 the key in ASCII armored format
259 gpg --export --armor | mail panther@tiger.int
261 This will send all your public keys to your friend panther.
263 If you have received a key from someone else you can put it
264 into your public keyring. This is called "importing"
266 gpg --import [filenames]
268 New keys are appended to your keyring and already existing
269 keys are updated. Note that GnuPG does not import keys that
272 Because anyone can claim that a public key belongs to her
273 we must have some way to check that a public key really belongs
274 to the owner. This can be achieved by comparing the key during
275 a phone call. Sure, it is not very easy to compare a binary file
276 by reading the complete hex dump of the file - GnuPG (and nearly
277 every other program used for management of cryptographic keys)
278 provides other solutions.
280 gpg --fingerprint <username>
282 prints the so called "fingerprint" of the given username which
283 is a sequence of hex bytes (which you may have noticed in mail
284 sigs or on business cards) that uniquely identifies the public
285 key - different keys will always have different fingerprints.
286 It is easy to compare fingerprints by phone and I suggest
287 that you print your fingerprint on the back of your business
288 card. To see the fingerprints of the secondary keys, you can
289 give the command twice; but this is normally not needed.
291 If you don't know the owner of the public key you are in trouble.
292 Suppose however that friend of yours knows someone who knows someone
293 who has met the owner of the public key at some computer conference.
294 Suppose that all the people between you and the public key holder
295 may now act as introducers to you. Introducers signing keys thereby
296 certify that they know the owner of the keys they sign. If you then
297 trust all the introducers to have correctly signed other keys, you
298 can be be sure that the other key really belongs to the one who
301 There are 2 steps to validate a key:
302 1. First check that there is a complete chain
303 of signed keys from the public key you want to use
304 and your key and verify each signature.
305 2. Make sure that you have full trust in the certificates
306 of all the introduces between the public key holder and
308 Step 2 is the more complicated part because there is no easy way
309 for a computer to decide who is trustworthy and who is not. GnuPG
310 leaves this decision to you and will ask you for a trust value
311 (here also referenced as the owner-trust of a key) for every key
312 needed to check the chain of certificates. You may choose from:
313 a) "I don't know" - then it is not possible to use any
314 of the chains of certificates, in which this key is used
315 as an introducer, to validate the target key. Use this if
316 you don't know the introducer.
317 b) "I do not trust" - Use this if you know that the introducer
318 does not do a good job in certifying other keys. The effect
319 is the same as with a) but for a) you may later want to
320 change the value because you got new information about this
322 c) "I trust marginally" - Use this if you assume that the
323 introducer knows what he is doing. Together with some
324 other marginally trusted keys, GnuPG validates the target
326 d) "I fully trust" - Use this if you really know that this
327 introducer does a good job when certifying other keys.
328 If all the introducer are of this trust value, GnuPG
329 normally needs only one chain of signatures to validate
330 a target key okay. (But this may be adjusted with the help
332 This information is confidential because it gives your personal
333 opinion on the trustworthiness of someone else. Therefore this data
334 is not stored in the keyring but in the "trustdb"
335 (~/.gnupg/trustdb.gpg). Do not assign a high trust value just
336 because the introducer is a friend of yours - decide how well she
337 understands the implications of key signatures and you may want to
338 tell her more about public key cryptography so you can later change
339 the trust value you assigned.
341 Okay, here is how GnuPG helps you with key management. Most stuff
342 is done with the --edit-key command
344 gpg --edit-key <keyid or username>
346 GnuPG displays some information about the key and then prompts
347 for a command (enter "help" to see a list of commands and see
348 the man page for a more detailed explanation). To sign a key
349 you select the user ID you want to sign by entering the number
350 that is displayed in the leftmost column (or do nothing if the
351 key has only one user ID) and then enter the command "sign" and
352 follow all the prompts. When you are ready, give the command
353 "save" (or use "quit" to cancel your actions).
355 If you want to sign the key with another of your user IDs, you
356 must give an "-u" option on the command line together with the
359 Normally you want to sign only one user ID because GnuPG
360 uses only one and this keeps the public key certificate
361 small. Because such key signatures are very important you
362 should make sure that the signatories of your key sign a user ID
363 which is very likely to stay for a long time - choose one with an
364 email address you have full control of or do not enter an email
365 address at all. In future GnuPG will have a way to tell which
366 user ID is the one with an email address you prefer - because
367 you have no signatures on this email address it is easy to change
368 this address. Remember, your signatories sign your public key (the
369 primary one) together with one of your user IDs - so it is not possible
370 to change the user ID later without voiding all the signatures.
372 Tip: If you hear about a key signing party on a computer conference
373 join it because this is a very convenient way to get your key
374 certified (But remember that signatures have nothing to to with the
375 trust you assign to a key).
378 8 Ways to Specify a User ID
379 --------------------------
380 There are several ways to specify a user ID, here are some examples.
382 * Only by the short keyid (prepend a zero if it begins with A..F):
389 * By a complete keyid:
398 "1234343434343434C434343434343434"
399 "123434343434343C3434343434343734349A3434"
400 "0E12343434343434343434EAB3484343434343434"
402 The first one is MD5 the others are ripemd160 or sha1.
404 * By an exact string:
406 "=Heinrich Heine <heinrichh@uni-duesseldorf.de>"
408 * By an email address:
410 "<heinrichh@uni-duesseldorf.de>"
414 "+Heinrich Heine duesseldorf"
416 All words must match exactly (not case sensitive) and appear in
417 any order in the user ID. Words are any sequences of letters,
418 digits, the underscore and characters with bit 7 set.
420 * Or by the usual substring:
425 The '*' indicates substring search explicitly.
430 If you use the option "--batch", GnuPG runs in non-interactive mode and
431 never prompts for input data. This does not even allow entering the
432 passphrase. Until we have a better solution (something like ssh-agent),
433 you can use the option "--passphrase-fd n", which works like PGP's
436 Batch mode also causes GnuPG to terminate as soon as a BAD signature is
442 GnuPG returns with an exit status of 1 if in batch mode and a bad signature
443 has been detected or 2 or higher for all other errors. You should parse
444 stderr or, better, the output of the fd specified with --status-fd to get
445 detailed information about the errors.
450 Here is a list of configure options which are sometime useful
453 --enable-static-rnd=<name>
454 Force the use of the random byte gathering
455 module <name>. Default is either to use /dev/random
456 or the auto mode. Value for name:
457 egd - Use the module which accesses the
458 Entropy Gathering Daemon. See the webpages
459 for more information about it.
460 unix - Use the standard Unix module which does not
461 have a very good performance.
462 linux - Use the module which accesses /dev/random.
463 This is the first choice and the default one
464 for GNU/Linux or *BSD.
465 auto - Compile linux, egd and unix in and
466 automagically select at runtime.
468 --with-egd-socket=<name>
469 This is only used when EGD is used as random
470 gatherer. GnuPG uses by default "~/.gnupg/entropy"
471 as the socket to connect EGD. Using this option the
472 socket name can be changed. You may use any filename
473 here with 2 exceptions: a filename starting with
474 "~/" uses the socket in the homedirectory of the user
475 and one starting with a "=" uses a socket in the
476 GnuPG homedirectory which is bye default "~/.gnupg".
479 Forces usage of the local zlib sources. Default is
480 to use the (shared) library of the system.
482 --with-included-gettext
483 Forces usage of the local gettext sources instead of
484 the one provided by your system.
487 Disable NLS support (See the file ABOUT-NLS)
490 Enable the integrated malloc checking code. Please
491 note that this feature does not work on all CPUs
492 (e.g. SunOS 5.7 on UltraSparc-2) and might give
496 If you have problems with dynamic loading, this
497 option disables all dynamic loading stuff. Note
498 that the use of dynamic linking is very limited.
501 Do not use assembler modules. It is not possible
502 to use this on some CPU types.
505 Disable all remote program execution. This
506 disables photo ID viewing as well as all keyserver
507 types aside from HKP.
509 --disable-photo-viewers
510 Disable only photo ID viewing.
512 --disable-keyserver-helpers
513 Disable only keyserver helpers (not including
516 --disable-keyserver-path
517 Disables the user's ability to use the exec-path
518 feature to add additional search directories when
519 executing a keyserver helper.
521 --with-photo-viewer=FIXED_VIEWER
522 Force the photo viewer to be FIXED_VIEWER and
523 disable any ability for the user to change it in
527 Installation Problems
528 ---------------------
529 If you get unresolved externals "gettext" you should run configure
530 again with the option "--with-included-gettext"; this is version
531 0.10.35 which is available at alpha.gnu.org.
533 If you have other compile problems, try the configure options
534 "--with-included-zlib" or "--disable-nls" (See ABOUT-NLS) or
537 We can't check all assembler files, so if you have problems
538 assembling them (or the program crashes) use --disable-asm with
539 ./configure. The configure scripts may consider several
540 subdirectories to get all available assembler files; be sure to
541 delete the correct ones. The assembler replacements are in C and
542 in mpi/generic; never delete udiv-qrnnd.S in any CPU directory,
543 because there may be no C substitute. Don't forget to delete
544 "config.cache" and run "./config.status --recheck".
546 Some make tools are broken - the best solution is to use GNU's
547 make. Try gmake or grab the sources from a GNU archive and
550 On some OSF you may get unresolved externals. This is a libtool
551 problem and the workaround is to manually remove all the "-lc -lz"
552 but the last one from the linker line and execute them manually.
554 On some architectures you see warnings like:
555 longlong.h:175: warning: function declaration isn't a prototype
557 http.c:647: warning: cast increases required alignment of target type
558 This doesn't matter and we know about it (actually it is due to
559 some warning options which we have enabled for gcc)
562 Specific problems on some machines
563 ----------------------------------
565 * IBM RS/6000 running AIX:
567 Due to a change in gcc (since version 2.8) the MPI stuff may
568 not build. In this case try to run configure using:
569 CFLAGS="-g -O2 -mcpu=powerpc" ./configure
571 * Compaq C V6.2 for alpha:
573 You may want to use the option "-msg-disable ptrmismatch1"
574 to get rid of the sign/unsigned char mismatch warnings.
576 * SVR4.2 (ESIX V4.2 cc)
578 Due to problems with the ESIX as, you probably want to do
579 CFLAGS="-O -K pentium" ./configure --disable-asm
580 Reported by Reinhard Wobst.
587 Random devices are available in Linux, FreeBSD and OpenBSD.
588 Operating systems without a random devices must use another
591 This collector works by running a lot of commands that yield more
592 or less unpredictable output and feds this as entropy into the
593 random generator - It should work reliably but you should check
594 whether it produces good output for your version of Unix. There
595 are some debug options to help you (see cipher/rndunix.c).
598 Creating an RPM package
599 -----------------------
600 The file scripts/gnupg.spec is used to build a RPM package (both
602 1. copy the spec file into /usr/src/redhat/SPECS
603 2. copy the tar file into /usr/src/redhat/SOURCES
604 3. type: rpm -ba SPECS/gnupg.spec
606 Or use the -t (--tarbuild) option of rpm:
607 1. rpm -ta gnupg-x.x.x.tar.gz
609 The binary rpm file can now be found in /usr/src/redhat/RPMS, source
610 rpm in /usr/src/redhat/SRPMS
613 How to Get More Information
614 ---------------------------
616 The primary WWW page is "http://www.gnupg.org"
617 The primary FTP site is "ftp://ftp.gnupg.org/gcrypt/"
619 See http://www.gnupg.org/mirrors.html for a list of mirrors
620 and use them if possible. You may also find GnuPG mirrored on
621 some of the regular GNU mirrors.
623 We have some mailing lists dedicated to GnuPG:
625 gnupg-announce@gnupg.org For important announcements like
626 new versions and such stuff.
627 This is a moderated list and has
630 gnupg-users@gnupg.org For general user discussion and
633 gnupg-devel@gnupg.org GnuPG developers main forum.
635 You subscribe to one of the list by sending mail with a subject
636 of "subscribe" to x-request@gnupg.org, where x is the name of the
637 mailing list (gnupg-announce, gnupg-users, etc.). An archive of
638 the mailing lists is available at http://lists.gnupg.org .
640 Please direct bug reports to <bug-gnupg@gnu.org> or post
641 them direct to the mailing list <gnupg-devel@gnupg.org>.
643 Please direct questions about GnuPG to the users mailing list or
644 one of the pgp newsgroups; please do not direct questions to one
645 of the authors directly as we are busy working on improvements
646 and bug fixes. Both mailing lists are watched by the authors
647 and we try to answer questions when time allows us to do so.
649 Commercial grade support for GnuPG is available; please see
650 the GNU service directory or search other resources.