Unusual (unintended?) behavor upon decryption of a message // follow-up correction

vedaal at nym.hush.com vedaal at nym.hush.com
Tue Nov 19 23:08:05 CET 2013


>If the message is encrypted to one public key, and also encrypted symmetrically instead of to a second public key, then the symmetric algorithm used by gnupg is the >same for the encryption of the session key to the public key, as well as the session key to the symmetrically encrypted part, as well as the encryption of the plaintext.

Sorry, was not writing clearly ;-((

Meant to say that the session key together with the prefix denoting which symmetric algorithm was used to encrypt the plaintext, is encrypted to the public key (using either RSA, DH, (or, hopefully soon, ECC),
and also as a symmetrically encrypted packet containing the session key and identifying algorithm prefix,
and then the symmetrically encrypted plaintext packet.

These two latter symmetrically encrypted packets, while the could  'theoretically' be using two different symmetric algorithms,
in fact use the same one, and that is the one identified as the algorithm used to encrypt the plaintext.

Here is the PGP Dump results for the ciphertext I originally posted:


PGPdump Results

Old: Public-Key Encrypted Session Key Packet(tag 1)(524 bytes) New version(3) Key ID - 0x506F4FA1D35FB186 Pub alg - RSA Encrypt or Sign(pub 1) RSA m^e mod n(4095 bits) - 5a 2d 7a e3 f9 99 af 2d 88 c1 ef 3b 8b 30 bf 94 d2 9f 68 ab 30 04 73 2e a2 7e 68 04 3a 00 6b 59 66 46 47 00 ec e8 6f e1 a8 40 5b b0 d9 87 ab a0 b2 23 4e 66 88 26 70 dc 74 d8 14 da 94 07 86 ce dd 48 37 0b cc d4 3d dd 5e b6 82 fb 04 47 13 fd fd b6 0c 7b 0e c2 c3 2b c8 1b c2 d4 e3 6b 68 85 85 b5 92 b2 1f c1 a7 1c ad f3 ed fb c3 2e 9e 4b a3 58 89 64 45 b1 b8 bb ba 7c 5b 2a 47 cd 42 d4 60 59 0b 9f 3a 16 1c 49 8d 92 ca d5 ba c4 fc 42 d1 56 bf 09 34 98 23 cf be 44 73 96 79 94 4b 55 6f 3d 8a bb f8 f1 4e b4 bd 94 0e 1f 1d 71 43 72 41 dc 7a b9 3e c2 5e 30 09 81 5e bf d6 e9 be e2 bd 85 a5 13 1a f1 31 d8 85 f0 07 ae 1a cc 4e cd aa d5 88 0c d8 51 83 ff 71 de cc d4 72 38 82 96 0a 0e d4 38 64 84 fe c7 a0 56 42 68 9b 04 88 79 cb 64 74 66 81 89 2c 41 d2 b1 2e af 31 5e 68 5e 20 79 c3 cc 13 30 55 16 8f 41 ca 16 56 fc 9c f8 07 7
 c 64 7b 07 61 3a 44 f5 49 f1 51 4e 84 e8 4b 91 e3 9f ee f2 5c e0 5b 40 40 25 2f 13 39 d5 8a a8 60 ae c2 5a fa 2b 3b a5 c0 66 17 6f e7 cb bf 1f 37 da d8 28 71 90 74 35 f2 bb 85 8e 3b 3f a0 79 c7 43 ab a1 fb 4b 01 5a a9 ed 21 1a cd 1b 0f 1f fc 14 7e 3f f6 ae 30 1c 8a fb 2b ea d8 bc 63 98 84 6c 1e b5 48 0d 74 f4 da 7e 44 dd 5c 25 28 68 f9 46 c4 6d ed 39 b7 d4 73 85 2d 3f eb fe 17 21 c3 7e 42 7d a7 01 e2 b6 ce 4f 3b 83 f3 af e9 04 ef 5a 20 cc e6 de d7 6e dc af 64 f0 d9 52 62 ca 27 80 58 78 53 47 9f 53 da 95 d6 21 f6 f3 98 0d 7e 7b ec 8c 1d 47 5a 57 55 e0 cb 34 30 04 69 46 6d b8 b9 32 c0 1c 29 da 6b 37 c4 a0 79 24 d1 07 fd 55 77 d4 6b af 88 91 91 8a 0d b8 f4 c8 50 21 21 7f 5a 3a c5 d3 97 a4 12 63 2f a2 4f 5f 7b -> m = sym alg(1 byte) + checksum(2 bytes) + PKCS-1 block type 02 

Old: Symmetric-Key Encrypted Session Key Packet(tag 3)(46 bytes) New version(4) Sym alg - Twofish with 256-bit key(sym 10) Iterated and salted string-to-key(s2k 3): Hash alg - SHA256(hash 8) Salt - 4d 55 b2 02 f0 1e e2 67 Count - 65536(coded count 96) Encrypted session key -> sym alg(1 bytes) + session key 

New: Symmetrically Encrypted and MDC Packet(tag 18)(71 bytes) Ver 1 Encrypted data [sym alg is specified in sym-key encrypted session key] (plain text + MDC SHA1(20 bytes))


vedaal




More information about the Gnupg-users mailing list