Hacker News new | ask | show | jobs
by Dylan16807 3837 days ago
> But, if we make the encrypted pieces small enough, say each packet body, then that could probably work

So in other words you can use what's basically the default mode of encryption, CBC. Each encrypted byte only depends on the adjacent 32 bytes, so you can allow errors through and they affect a couple pixels instead of a single pixel.

1 comments

I wasn't aware of CBC at the time of writing this comment, thanks for pointing it out to me.

It seems if you lose any 32 bytes though you've lost the trail of encryption as you can't decrypt any subsequent pieces.

After reading other comments I think the only reliable solution is chacha20 where each packet can be encrypted/decrypted independently of others.

https://upload.wikimedia.org/wikipedia/commons/2/2a/CBC_decr...

Let's assume CBC with AES. It encrypts in 16 byte blocks. If you slightly corrupt one block, you will fail to decrypt it entirely, and it will slightly corrupt the block after, but everything else will be fine.

There are modes of encryption where losing one bit will corrupt all subsequent bits.

There are also modes like GCM or stream ciphers like ChaCha20 where one corrupted bit will not corrupt any other bits at all.

In short: There are many options, and half of them are suitable for this.