Getting the plaintext from cipher text

Hello,

Can you get the plain text from it's cipher text if said plain text is encrypted with the plain text (plain text and key are the same), when using AES?

Many thanks.

Posted Oct 28, 2019, 8:23 PM UTC

49
Pharisaeus•

No, not in general. However, just the fact that key = plaintext might suggest for example that the keyspace is significantly cut down, and might be in NSA-bruteforce range.

4
NattyTwoOP•

Cheers.

1
bllinker•

So to start, AES is a block cipher so you likely need to talk about what mode of operation.

But the short answer is that as far as I've seen, there is no attack based off of particular or arbitrary plaintext-ciphertext combinations.

2
NattyTwoOP•

Thank you for your reply

1
doubles_avocado•

I’ve never heard of any attack that would target a scenario like this, and I can’t find one online. However, I’m guessing that it’s an unlikely enough setup that nobody has really bothered to try. There at least doesn’t seem to be an obvious, trivial attack. But there’s no good reason to believe that it’s safe either. It’s definitely not “required” by any design goals that AES be secure when the plaintext equals the key.

1
NattyTwoOP•

Thanks.

1
cryslith•

In general the answer is that it might not be secure, though practically it is probably fine for most real ciphers such as AES. Here is a blog post which gives a brief overview of this topic.

1
NattyTwoOP•

Thank you.

1
Akalamiammiam•

This is an interesting question, and I'd say that in that case, it's mostly equivalent to AES with one less round.

The key (K) and the plaintext (P) being the same means that P + K = 0, where + is the XOR operation. Assuming you're familiar with how AES works, the encryption would go like this :

  • The first step of AES is to XOR the plaintext and the first round key K0, but the first round key is equal to the key itself. So you compute K0 + P = K + P = 0.
  • Then you apply the round function to 0, which is a public function, so you get X = MC(SR(SB(0))), and even though you didn't know the value of K and P, you know the value of X.
  • Now you need to add the next round key, i.e. compute Y = K1 + X. However, now K1 is computed from the key-schedule of AES and from K0. Since you don't know K0, you cannot compute Y. Moreover, the key-schedule is invertible, so any value of K1 is possible.

In the end, what remains is essentially the encryption of X with the key K1, but only over 9 rounds of AES (it's actually slightly more subtle than that since there are some round constants, but still).

I owuld not claim that it is completely equivalent, but it would be close enough to it to not caring about it.

1