0
$\begingroup$

Just to preface this I'm very new to cryptography. However, I've been reading that ECB should not be used under most circumstances due to its symmetry which allows attackers to gain information about the plaintext from observations of the ciphertext.

It got me thinking about a way obfuscate patterns in the plaintext before encryption occurs.

Let's say for instance each block of plaintext is XOR'd with a randomly generated "key" of maybe 1 or 2 bytes that is stored with the block and then encrypted along with it, effectively hiding any observable pattern.

In this manner wouldn't the obvious attacks that ECB would normally be prone to be completely dismantled?

$\endgroup$
  • $\begingroup$ That 1- or 2- byte key of yours, is that repeated or zero-padded to block size? $\endgroup$ – DannyNiu Apr 30 at 5:38
  • $\begingroup$ I envisioned it replacing the first part of every block, effectively shifting all of the data down. I'm not sure if that would work, but that's what I had in mind. $\endgroup$ – Radix Apr 30 at 5:41
  • $\begingroup$ Now you're reinventing stream ciphers $\endgroup$ – Natanael Apr 30 at 13:08
1
$\begingroup$

Let's say for instance

  • each block of plaintext is XOR'd with

    1. a randomly generated key

    2. that is stored with the block

and then encrypted along with it, effectively hiding any observable pattern.

For 1. you need as much entropy as the amount of information in the message.

For 2. you need double the storage for ciphertext.

The clever audience may have observed by this point, that it's just a convoluted way to make one-time-pad insecure against unbounded adversary.

$\endgroup$
  • $\begingroup$ What I had in mind was more one randomly generated byte that was XOR'd with the other bytes of the block, not necessarily a key of equivalent size. Sorry, I should have made that more clear in the original post. $\endgroup$ – Radix Apr 30 at 5:32
  • 1
    $\begingroup$ Well, if you are using the same key for xoring multiple parts of your messages, you are likely to end up with recognizable patterns in the cyphertext again, i.e., same blocks of plaintext xored with the same key and encrypted in ECB will still be the same. Is this what you had in mind or am I missing something? $\endgroup$ – grees Apr 30 at 6:25
  • $\begingroup$ @grees You're absolutely right, but I was thinking randomly generated keys per block. Just something small that would introduce enough noise to prevent those common attacks. $\endgroup$ – Radix Apr 30 at 6:58
  • 1
    $\begingroup$ But then you have a one time pad, right? So why bother with Blockciphers at all? $\endgroup$ – grees Apr 30 at 7:18
  • $\begingroup$ After doing some additional research, I think Mr. Niu is correct. This is just a bad one time pad that is insecure vs an attacker with unbounded computing power. Thanks for your input! $\endgroup$ – Radix Apr 30 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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