50. Steganography

Hiding data in an image's least significant bits and then later recovering the data is simple in principle, but it's complicated by the way images store pixel values. A typical 32-bit color image uses 8 bits to store each of a pixel's red, green, blue, and alpha (transparency) color components. We won't use the alpha component because that might cause a noticeable change when parts of the image become slightly transparent. That means we can store three bits of data per pixel.

Unfortunately, data is usually stored in bytes, so a byte of data might start in one pixel and end partway through another pixel.

An alternative storage strategy would be to use three pixels (giving nine bits) to store each 8-bit byte and just ignore ...

Get Improving your C# Skills now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.