Hacker News new | ask | show | jobs
by mirages 1337 days ago
Why does a diagonal pattern appears when doing that kind of encryption ?
1 comments

I'm guessing that the block size is a power of 2, but it's not divisible by 3, meanwhile the pixel size (and so the line width) is divisible by 3. Misalignments in a line will cause diagonal patterns.
Correct: at least for the recreated version[1], the blocksize is 128 but the pixels are uncompressed 24-bit RGB values. So you end up with 5.33 (repeating) pixels per block, which makes running spans of of the same color transform into runs of a different color with a little bit of "noise" (always the same) at the end.

Do that enough and wrap it around at the width, and you end up with a diagonal/houndstooth-like pattern.

[1]: https://words.filippo.io/the-ecb-penguin/