Bug report originally posted here: https://bitbucket.org/vinay.sajip/python-gnupg/issues/139/python-wrapper-for-gnupg-second-key
I wrote a very simple example provided in the link above showing a confusing result I encountered. I create 2 keys and encrypt 3 messages with the first key and another 3 messages with the second key. I then try to decrypt all of the messages with each key. What I expect is that the first key can only decrypt the first 3 messages and the second key can only decrypt the second 3 messages. However, what happens is that the first key can only decrypt the first 3 messages (as expected) yet the second key can decrypt all of the messages. Why is this happening and how do I produce the expected results?
I am using Ubuntu 5.4.0-88-generic, Python 3.8.10, GnuPG 2.2.19, libgcrypt 1.8.5, python-gnupg 0.4.7