For example (very simplified one) usually encryption/decryption works like this:

encrypted_data = encrypt(data, key)
data = decrypt(encrypted_data, key)

I wonder, if it is possible to modify input data so that the function encrypt would become reversible without the key (here the modification is denoted as +x):

encrypted_data = encrypt(data+x, key)
data = modified_decrypt(encrypted_data , x)

What I mean by the modification is: maybe it is possible to do with an addition of some repeating pattern to the input data, or may be by permutation, or may be by finding specific x as a function of data...

If it is, then how? If it's not, why?

I know, it would be specific to an encryption algorithm. So I need to know, if this is possible with any popular encryption algorithm?

P.S. possible applications are: data recovery after such viruses as wannacry, or an identification of an informational leakages in organizations, etc.

1 Answer 1


What you describe is termed a chosen-plaintext attack, or CPA. All good, modern ciphers are not at all vulnerable to CPA. In particular, the US standard cipher AES is not vulnerable to this attack or any of its variations. Any cipher which is vulnerable to this is typically considered to be badly broken.

  • Just want to add here that stream ciphers tend to have this vulnerability contrasted with block ciphers (like AES) which tend not to be vulnerable. Feb 4, 2019 at 10:02
  • 1
    @AndrewPhilips Actually it's usually the other way around. For most stream ciphers, a CPA can only be turned into a KPA (Known-Plaintext Attack) because an attacker cannot affect the state of the cipher. Compare this with block ciphers in modes like CBC where an attacker can influence the internal state.
    – forest
    Feb 5, 2019 at 5:43
  • I think I was thinking of reused keys, so not CPA. Feb 5, 2019 at 6:17

You must log in to answer this question.

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