Suppose I wanted to upload a text file to a malicious cloud storage provider. Would the file be more secure against decryption if AFTER encrypting it (say with the AES scheme), I flipped certain bits of the ciphertext, for example according to the scheme below:


Obviously the cost of "storing" or "remembering" the scheme is minimal, and more complex schemes could easily be devised

  • 3
    $\begingroup$ Well, this essentially adds another layer of encryption on-top with the pattern being the key for this layer. It should make a case of "infeasible" (only AES) vs "infeasible" (AES and this scheme). $\endgroup$
    – SEJPM
    Commented Apr 2, 2018 at 11:47
  • $\begingroup$ Would crypto.stackexchange.com/q/27813/23115 help? $\endgroup$
    – Paul Uszak
    Commented Apr 2, 2018 at 16:08
  • $\begingroup$ There is no such thing as "the AES scheme". AES is a block cipher; it only turns into a real cipher when combined with a mode of operation. The properties of that cipher depend on the mode mostly - as long as AES itself isn't broken. $\endgroup$
    – Maarten Bodewes
    Commented Apr 3, 2018 at 9:40

1 Answer 1


First of all, your change doesn't involve a key, so it isn't really a cipher. It requires knowledge of a pattern, but that goes against Kerckhoffs principle; the knowledge of an algorithm shouldn't influence security.

Second, you're flipping only specific bits. It depends on the mode of operation on how much that changes the decryption. If a stream cipher or streaming mode of operation is used then only those specific bits in the plaintext are flipped. It is very likely that the result will be easy to distinguish from random, which lets an attacker know that decryption succeeded. Things may be different for other modes of operations like CBC.

Third: you say that more complex schemes can be easily derived. That's a lot like handwaving. One obvious scheme would be another cipher with a fixed key. Yes, that would work, but in that case you have to communicate the key / algorithm with the other party. Basically you would have double encryption but without the necessary key management.

Finally, AES is already thought to be secure. AES-256 is even thought to be secure against attacks that involve quantum computers. Having an additional layer with very low complexity doesn't make all that much sense; AES is in itself much more complex.

Using an additional pattern could make finding a key in a password based encryption slightly more complex (as dictionary attacks are much more feasible than brute forcing AES) but even then I would rather focus on the security of the password itself.

Does it add some complexity? Sure, but it is unlikely to affect the attacks much. And even if it does, it depends on the attacker now knowing the scheme, going against Kerckhoffs principle.

  • $\begingroup$ Actually one could have the view that the encryption algorithm is simple XOR and the key is the pattern.... $\endgroup$
    – SEJPM
    Commented Apr 3, 2018 at 11:49
  • $\begingroup$ @SEJPM Sure, but as long as the pattern depends on an algorithm to generate it, you need to have some kind of mechanism to select that algorithm. If it is a static bit pattern then it is an OTP. $\endgroup$
    – Maarten Bodewes
    Commented Apr 3, 2018 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.