1

Is it possible to perform a known-plaintext attack to extract the key from AES byte encryption?

The encryption is setup with the following two lines:

ctr = Counter.new(128)
crypt = AES.new(key, AES.MODE_CTR, counter=ctr)

And we have both the plaintext and the ciphertext

kelalaka
  • 49,797
  • 12
  • 123
  • 211
Silvia Inden
  • 13
  • 1
  • 3

1 Answers1

1

The answer is simply no;

The known-plaintext attack on AES-CTR mode will reveal the encrypted output of the AES $$c_i = p_i \oplus E_k(ctr+i)$$ $$ c_i \oplus p_i = E_k(ctr+i)$$

and since in the counter mode, we know the counter values (input to the AES in CTR mode), we can see this as known-plaintext attack on ECB mode.

The possibility of known-plaintext attack on AES in ECB mode is given lately as;

No. This is what is referred to as a known plaintext attack, and secure block ciphers are designed to prevent exactly this kind of attack. This answer on the Mathematics Stack Exchange goes into more detail about the notion of IND-CPA ("indistinguishability") which AES is conjectured to meet and how that implies that a known plaintext attack is impossible.

kelalaka
  • 49,797
  • 12
  • 123
  • 211