1 A Hacker's Guide to GNUPG
2 ================================
3 (Some notes on GNUPG internals.)
6 ===> Under construction <=======
12 1423 Privacy Enhancement for Internet Electronic Mail:
13 Part III: Algorithms, Modes, and Identifiers.
15 1489 Registration of a Cyrillic Character Set.
17 1750 Randomness Recommendations for Security.
19 1991 PGP Message Exchange Formats.
21 2015 MIME Security with Pretty Good Privacy (PGP).
23 2144 The CAST-128 Encryption Algorithm.
25 2279 UTF-8, a transformation format of ISO 10646.
34 ./agent Gpg-agent and related tools
37 ./g10 Gpg program here called gpg2
38 ./jnlib Utility functions
40 ./scd Smartcard daemon
41 ./scripts Scripts needed by configure and others
47 g10/gpg.c Main module with option parsing and all the stuff you have
48 to do on startup. Also has the exout handler and some
50 g10/sign.c Create signature and optionally encrypt
55 Parsing and creating of OpenPGP message packets.
57 g10/getkey.c Key selection code
58 g10/pkclist.c Build a list of public keys
59 g10/skclist.c Build a list of secret keys
60 g10/ringedit.c Keyring I/O
63 g10/keyid.c Helper functions to get the keyid, fingerprint etc.
69 Management of the trustdb.gpg
71 g10/compress.c Filter to handle compression
72 g10/filter.h Declarations for all filter functions
73 g10/delkey.c Delete a key
74 g10/kbnode.c Helper for the KBNODE linked list
75 g10/main.h Prototypes and some constants
76 g10/mainproc.c Message processing
77 g10/armor.c Ascii armor filter
78 g10/mdfilter.c Filter to calculate hashs
79 g10/textfilter.c Filter to handle CR/LF and trailing white space
80 g10/cipher.c En-/Decryption filter
81 g10/misc.c Utlity functions
82 g10/options.h Structure with all the command line options
84 g10/openfile.c Create/Open Files
85 g10/tdbio.c I/O handling for the trustdb.gpg
87 g10/hkp.h Keyserver access
89 g10/packet.h Defintion of OpenPGP structures.
90 g10/passphrase.c Passphrase handling code
118 Use only the functions:
135 The *secure versions allocated memory in the secure memory. That is,
136 swapping out of this memory is avoided and is gets overwritten on
137 free. Use this for passphrases, session keys and other sensitive
138 material. This memory set aside for secure memory is linited to a few
139 k. In general the function don't print a memeory message and
140 terminate the process if there is not enough memory available. The
141 "try" versions of the functions return NULL instead.
154 GNUPG does not use getopt or GNU getopt but functions of it's own. See
155 util/argparse.c for details. The advantage of these functions is that
156 it is more easy to display and maintain the help texts for the options.
157 The same option table is also used to parse resource files.
163 This is the data structure used for most I/O of gnupg. It is similar
164 to System V Streams but much simpler. Because OpenPGP messages are nested
165 in different ways; the use of such a system has big advantages. Here is
166 an example, how it works: If the parser sees a packet header with a partial
167 length, it pushes the block_filter onto the IOBUF to handle these partial
168 length packets: from now on you don't have to worry about this. When it sees
169 a compressed packet it pushes the uncompress filter and the next read byte
170 is one which has already been uncompressed by this filter. Same goes for
171 enciphered packet, plaintext packets and so on. The file g10/encode.c
172 might be a good staring point to see how it is used - actually this is
173 the other way: constructing messages using pushed filters but it may be
174 easier to understand.