http://tools.ietf.org/html/rfc4880#section-5.1
A Public-Key Encrypted Session Key packet holds the session key used to encrypt a message. Zero or more Public-Key Encrypted Session Key packets and/or Symmetric-Key Encrypted Session Key packets may precede a Symmetrically Encrypted Data Packet, which holds an encrypted message. The message is encrypted with the session key, and the session key is itself encrypted and stored in the Encrypted Session Key packet(s). The Symmetrically Encrypted Data Packet is preceded by one Public-Key Encrypted Session Key packet for each OpenPGP key to which the message is encrypted. The recipient of the message finds a session key that is encrypted to their public key, decrypts the session key, and then uses the session key to decrypt the message.
The body of this packet consists of:
-
A one-octet number giving the version number of the packet type. The currently defined value for packet version is 3.
-
An eight-octet number that gives the Key ID of the public key to which the session key is encrypted. If the session key is encrypted to a subkey, then the Key ID of this subkey is used here instead of the Key ID of the primary key.
-
A one-octet number giving the public-key algorithm used.
-
A string of octets that is the encrypted session key. This string takes up the remainder of the packet, and its contents are dependent on the public-key algorithm used.
→ echo "hi" | gpg -v --encrypt --recipient [email protected] --recipient [email protected] | hexdump
gpg: using PGP trust model
gpg: using subkey 535A7353 instead of primary key 94F8D7EA
gpg: 535A7353: There is no assurance this key belongs to the named user
pub 4096R/535A7353 2014-03-20 Jon Canady ([email protected]) <[email protected]>
Primary key fingerprint: FE37 0AFC ED4B CBFA EBAB F339 061C 7E88 94F8 D7EA
Subkey fingerprint: 1E79 D9B9 A8B2 3AF5 EE67 279D AD5E DB20 535A 7353
It is NOT certain that the key belongs to the person named
in the user ID. If you *really* know what you are doing,
you may answer the next question with yes.
Use this key anyway? (y/N) y
gpg: using subkey C27A876B instead of primary key 56173D76
gpg: This key belongs to us
gpg: reading from `[stdin]'
gpg: writing to stdout
gpg: RSA/AES256 encrypted for: "C27A876B Mark Lorenz <[email protected]>"
gpg: RSA/AES256 encrypted for: "535A7353 Jon Canady ([email protected]) <[email protected]>"
0000000 85 01 0c 03 ba ae ba 69(c2 7a 87 6b)01 08 00 aa
0000010 71 aa 18 43 73 6b 87 6f b1 c8 09 ea b2 03 82 07
0000020 f2 69 27 39 d3 3f 9b 91 47 c3 59 e0 73 c4 ef 60
0000030 1c b5 ab ec 73 15 35 62 89 41 d3 13 b7 1f d8 51
0000040 0a 3a 3e ca c4 34 a0 1d ff 70 68 ea 23 d3 8f 75
0000050 58 e8 75 4c 1e 08 49 14 69 39 d9 57 04 6d 06 db
0000060 b0 2d 0b 39 30 55 74 c4 88 08 78 95 5b f2 b2 a0
0000070 d3 d3 01 09 d2 f0 f5 b7 1c 03 95 75 df 7c 30 c4
0000080 7f c8 a8 2b 82 b1 d7 e9 69 4e 44 cd f7 75 f7 0f
0000090 df dd d3 d6 ab 78 87 62 d6 b8 53 ec 63 1f 33 7a
00000a0 55 38 cc a4 00 de 17 f8 83 93 d5 1a ca 7e 1e ad
00000b0 af 12 16 5e 7f 74 07 72 74 82 33 92 d7 c5 6f d6
00000c0 2a b3 b5 6d 88 54 f0 fc 66 d0 e9 4e 0e d9 43 8b
00000d0 a5 ae 4c a0 b8 8d 8e 1b 83 1d 9c 89 81 e9 8e 1f
00000e0 9e b4 27 54 24 29 d1 de 09 3b d4 49 ef 3e 62 79
00000f0 1a ce 18 21 4f b8 07 df e9 90 b2 8d d9 0a 5e c9
0000100 3c f5 5e eb ff 44 e6 68 be 12 85 55 8b 74 58 85
0000110 02 0c 03 ad 5e db 20(53 5a 73 53)01 0f ff 69 65
0000120 6a ed ca 11 c8 98 80 22 bd d7 0e d5 29 4b c0 e1
0000130 49 a5 9d b9 65 e7 78 2a 25 2f 56 9b 18 c5 8e 1a
0000140 ca b9 69 eb 90 83 3a 13 fb 53 1a 06 1a e7 07 4c
0000150 85 4f d5 f9 81 dd b3 a7 58 08 12 7d e7 50 01 14
0000160 73 c3 37 ef a9 0a f2 fd 34 d3 98 35 f4 d1 c9 e5
0000170 10 82 29 00 3e 76 66 1a a1 ee 5e aa 71 38 c5 56
0000180 be 66 eb 6e f0 d2 3e 76 7a ed 8d c1 8a 82 88 f8
0000190 5d a4 41 87 ce 1f f4 bc c6 be e5 9f 08 8e fc 06
00001a0 dd 3c 0d 00 72 db 70 c2 81 20 50 de 35 e0 7b 67
00001b0 19 84 d3 12 e9 2d e9 f6 03 ce db 22 16 aa 97 b5
00001c0 34 37 9f 15 3b 82 ee 30 b9 9e 90 52 be 92 64 2c
00001d0 3a bc f4 6e 76 4c dc 4f 43 9e 8f 8b 33 29 cc 7d
00001e0 d7 5b cd 3e 9e 47 4b d3 e6 e6 96 17 f3 bc 08 e4
00001f0 ae e7 27 b1 a1 0d cc 45 c8 06 5c 2c d7 3e de b3
0000200 9e 50 a8 94 3b 78 44 7b 92 07 5c 0f ac 06 a4 ed
0000210 e5 5a 4b 84 b2 51 97 7c 57 a5 61 48 6d ee cf fc
0000220 56 7e 0b 6b 56 71 ae 27 d1 c1 50 44 2b 14 73 09
0000230 f5 e8 8f c9 96 c9 d9 d3 42 c1 5f d9 fd 31 db fc
0000240 4b 39 ec c6 ec 16 18 92 6e 20 19 e6 13 5e 66 cf
0000250 2b c1 0c e7 73 c9 c0 3d 06 56 52 90 5c 07 2e 3d
0000260 6a 44 a2 e6 c5 c2 43 ad d5 64 c1 56 27 df a1 c0
0000270 37 b7 f0 ab c5 c4 d4 7e 86 1e b7 19 6d e1 63 f0
0000280 f3 18 84 82 0a 68 74 cc af 68 e5 6f 64 98 d3 33
0000290 45 7a b4 c8 71 a1 89 1e 69 80 82 1e f2 97 a2 e8
00002a0 4f c3 3c 15 fa a2 3c 17 27 b3 45 64 e3 cb 61 5d
00002b0 ac ec 66 7e 1b ec a4 3a a0 62 c7 95 a6 f5 ab 65
00002c0 20 d0 9b 9c 12 27 ee fe f4 90 53 9b 3c b0 5f 4b
00002d0 d4 78 cb ca be a2 dd 65 b1 e0 a5 40 77 19 8e 5f
00002e0 7f 43 81 6b 63 60 ab a4 f3 41 6c ca 70 b7 cd e1
00002f0 65 95 fe 00 28 c9 6c ea 63 a8 7e 7d f2 30 f6 f6
0000300 79 52 29 7d cd 8a 97 9d 30 90 2d 8d 5e 89 84 d4
0000310 66 4e e4 f4 49 b4 5b 27 ba 24 17 be f9 28 d2 3e
0000320 01 62 21 55 6c 26 df 07 0a f4 ee e1 8e f5 24 a4
0000330 a4 cb 05 40 b7 e2 b6 af 6b 99 2e 7d 20 47 2d 97
0000340 73 23 1a 8e dc 2f 5c 1a 1f b6 16 0c e2 86 c1 fd
0000350 3a 53 12 cb fe 5d a5 96 c4 ee b3 1c 6b ed
000035e