While playing around with new test key I found out a weird behavior. If I generate a new RSA2048 bit key and encrypt a text for that new key then the text is encrypted for that new key but also for a recipient for which a have a public key for in my keychain.
Generate a basic RSA2408 key
# gpg --version gpg (GnuPG) 2.2.5 libgcrypt 1.8.2 # gpg --gen-key # gpg --list-secret-keys sec rsa2048/0x29969EB210C060E7 2018-03-09 [SC] [expires: 2020-03-08] Key fingerprint = F5D3 B260 4597 1B7F 28C6 52E3 2996 9EB2 10C0 60E7 uid [ultimate] Rsa Test <rsa@test.org> ssb rsa2048/0xC38736A7DF9D89FC 2018-03-09 [E] [expires: 2020-03-08]
Encrypt a text for that RSA keys
# echo "ABCD" > test5.me # gpg -e -armor -r 0x29969EB210C060E7 test5.me
Decrypt the result
# gpg -d test5.me.asc gpg: encrypted with 4096-bit ELG key, ID 0x2A7FA384BC46FB30, created 2005-02-27 "Douglas Eugene Morris <doug@onewebplace.com>" gpg: encrypted with 2048-bit RSA key, ID 0xC38736A7DF9D89FC, created 2018-03-09 "Rsa Test <rsa@test.org>" ABCD
More details
# gpg --list-packets test5.me.asc gpg: encrypted with 4096-bit ELG key, ID 0x2A7FA384BC46FB30, created 2005-02-27 "Douglas Eugene Morris <doug@onewebplace.com>" gpg: encrypted with 2048-bit RSA key, ID 0xC38736A7DF9D89FC, created 2018-03-09 "Rsa Test <rsa@test.org>" # off=0 ctb=85 tag=1 hlen=3 plen=1038 :pubkey enc packet: version 3, algo 16, keyid 2A7FA384BC46FB30 data: [4095 bits] data: [4096 bits] # off=1041 ctb=85 tag=1 hlen=3 plen=268 :pubkey enc packet: version 3, algo 1, keyid C38736A7DF9D89FC data: [2048 bits] # off=1312 ctb=d2 tag=18 hlen=2 plen=58 new-ctb :encrypted data packet: length: 58 mdc_method: 2 # off=1325 ctb=a3 tag=8 hlen=1 plen=0 indeterminate :compressed packet: algo=1 # off=1327 ctb=ac tag=11 hlen=2 plen=19 :literal data packet: mode b (62), created 1520637559, name="test5.me", raw data: 5 bytes
Get more information about the pub key that is used in addition to the one I specified
# gpg --list-keys 0x2A7FA384BC46FB30 pub dsa1024/0xAFB5238802E2F4BD 2005-02-27 [SCA] Key fingerprint = 07DB FD88 8A1C 5E0D 3623 E5AC AFB5 2388 02E2 F4BD uid [ full ] Douglas Eugene Morris <doug@onewebplace.com> uid [ full ] Douglas Eugene Morris <doug@kenohki.com> uid [ full ] GSWoT:1:309:02E2F4BD sub elg4096/0x2A7FA384BC46FB30 2005-02-27 [E]