Big curiosity

Andreas Mattheiss at publicly.invalid
Sun Jun 13 19:42:01 CEST 2021


a bit of elaborating on this one.

Am Sun, 13 Jun 2021 18:58:54 +0200 schrieb Johan Wevers <johanw at>:
> On 13-06-2021 16:06, knighttemplar5--- via Gnupg-users wrote:
>> I have been contemplating subscribing to an email forwarding service
>> that will encrypt all the forwarded mails to me with my public key.
>> Lets imagine the country where the forwarding takes place can see all my
>> emails in plain text and at the same time the same emails PGP encrypted,
>> can enough of this data pose a threat to my private key?
> What you describe is in cryptography known as a known-plaintext attack.


> It can happen in a less obvious way. For example I remember the old Word
> Perfect 5 for DOS that had the option to encrypt its files. It did that
> by XORing the entire file with your password. However, because the first
> few bytes of a WP file were always the same it was trivial to deduct the
> password from a file that was encrypted with this method.

Yet let us keep in mind that gpg (or any practical assymetric encryption
kit out there) consists of two elements: an asymmetric encryption and
a symmetric encryption. The XOR is the symmetric part, and there is
a lot of discussion on the resilience of a symmetric cipher to chosen
plaintext attacks when it is being reviewed. XOR is a good example here
because it is so poor in this respect. Modern variants are thought to
be resilient against this type of attacs - typical reviews might tell
you that in order to break a 128 bit key one would need 2**90 or so
texts and their encrypted equivalent. The actual number for gpg security
is practically not relevant, since for gpg you'll get a different
symmetric key each time you encrypt another file.

This is because gpg actually only encrypts this symmetric key with the
assymetric code, like RSA - typically not more than 256 bit of arbitrary
nature. For the assymetric code the world is different - anybody who
has access to the public key can generate as many plaintext/ciphertext
pairs as he wants. Yet I am not aware of any (relevant) choosen plaintext
attacs against RSA & friends - this would immediately render it useless,
for any application.

> So, in short, the answer to your question is "no, it is not a threat".

Absolutely right. You should be more concerned to understand what
this type of incoming mail encryption is good for - and what it can't
prevent. It is not as useful as you may think; the mail provider could
still read your plaintext mail, even though he may promise you to encrypt
things directly after receiving. The link from your email provider to you
is, these days, already encrypted, so no benefit there neither. The one
benefit is that if someone hacks your mail provider he can't do anything
with your mails he may find there, since they are all encrypted. So yes
it is useful, but only in a specific way.

Hope this helps, regards

Lister: Everything?s really nice there. They even shampoo the rats.
Groom their tails and everything!

More information about the Gnupg-users mailing list