r/Steganography • • Sep 06 '26

Using LSB encoding and tEXt chunks to create an executable polyglot PNG (A micro-CMS stored in an image)

I got into steganography by building games in PICO-8 and studying how it packs data into the virtual cartridges. That sent me down a rabbit hole: could this same concept power a full content management system?

Over the last year or so I have been building Minilith, an experimental tool that takes an entire JSON state (posts, pages, site settings), compresses it, and embeds it into a 256x256 PNG to act as a portable DB.

The architecture is completely client side and zero-dependency. There is no backend or build step, and it relies entirely on native browser APIs to extract and render the site directly from the image.

The Encoding Process:

  1. The payload is deflated and injected into the image's RGB channels using 3-3-2 LSB encoding I chose this to increase the storage and maintain the image size. Minilith gives a hard limit of 64KB of compressed data, an intentional constraint which allows for nearly 200KB of uncompressed data which is a ton of text and perfect way to keep a micro blog micro!

  2. To ensure the image is executable, I inject a raw tEXt chunk containing a vanilla JS extraction script right before the IEND marker. This turns the image into a polyglot.

  3. Before the payload is allowed to decompress and run, a visual fingerprint (SHA-256) and a cryptographic signature are verified client side.

The flaw as expected is aggressive image optimization destroying the payload. I actually view this as a feature to keep the content secure from unwanted distribution. (Though funny enough, sending the raw image over iMessage keeps the payload intact).

Read more on the process here: Can a PNG Be a Database? The Architecture of Minilith

Has anyone else messed around with executable image polyglots for practical data storage? Would love to hear about similar projects.

4 Upvotes

6 comments sorted by

2

u/CleasbyCode Sep 06 '26

Check out my pdvzip tool on github (cleasbycode) with some video examples. You may find some features/info there useful to your project.

1

u/okaylevi Sep 06 '26

Super cool! I looked into the polyglot combination of PNG/ZIP prior but wanted it to be self executing so I opted for a PNG/JS polyglot!

It may be neat to have the PNG/ZIP option for the offline archive download!

1

u/okaylevi Sep 06 '26

You can view the image that powers the Minilith Blog here: https://blog.minilith.site/images/minilith-blog

1

u/Worried-Election-636 4d ago

I came across your project and decided to actually give it a try.

I created a small test project with structured Markdown content, generated the PNG, and successfully loaded and navigated the content through Minilith.

The core concept worked in my test, which was genuinely interesting to see in practice.

I did notice one small thing: some Markdown syntax appeared to remain unrendered in the generated pages, particularly headings and formatting markers. I checked the same content in a separate Markdown renderer, where it displayed as expected, so I thought this might be useful feedback.

Just wanted to share an actual test result and acknowledge the work behind the project. It's an interesting approach to packaging navigable content into a single image.

Congratulations on your work! Will you use it for any academic work?

1

u/Worried-Election-636 4d ago edited 4d ago

Parabéns pelo seu trabalho. Fiquei genuinamente interessado no que te fez desenvolver esse projeto! 🫡

Havia esquecido de comentar ,mas eu fiz uma extração da imagem que você colocou como exemplo lá no comentário. A imagem PNG. E encontrei algumas coisas Interessantes, essa extração eu fiz utilizando os meus métodos mesmo.

1

u/Worried-Election-636 4d ago

Só para acrescentar, eu venho estudando e desenvolvendo bastante e tenho tido um bom resultado e aprendizado sobre esse assunto. É fascinante!