0

I have somebody's public PGP key imported on my laptop (Debian Linux), but not their private key. When I encrypt a file to them using their public key, I can then decrypt it again even though I don't have their private key. Through experimentation, it appears that my secret key also works to decrypt the file, even though I selected the other person as the recipient. Is this intended behavior? How can two different private keys decrypt the same file? Is it actually using AES encryption to encrypt the data and then just locking the AES keys behind our respective PGP keys? This would also explain why, in PGP encrypted chat apps like XMPP, I can read my own messages on devices that I didn't send it from without compromising the security of the message, but my basic understanding of asymmetric encryption was that once something was encrypted with somebody else's public key, nothing but the intended persons' private key could decrypt it.

0

1 Answer 1

1

The data is encrypted with a session key using symmetric encryption and the session key is encrypted with the public keys of the recipients. It is typical to add the sender to the list of recipients so that also the sender can later decrypt the message.

Using the session key has two benefits:

  • Symmetric encryption is faster and, therefore, more suitable for encrypting longer data.
  • The length of the cipher text does not multiply when there are multiple recipients.

Not the answer you're looking for? Browse other questions tagged .