The other day, a Twitter user (David Buchanan, @David3141593) posted a message that gained some attention. It has an attached JPEG file, with an image

About that JPEG/ZIP/Shakespeare hybrid file

submited by
Style Pass
2024-11-16 06:00:19

The other day, a Twitter user (David Buchanan, @David3141593) posted a message that gained some attention. It has an attached JPEG file, with an image of William Shakespeare. If you save a copy of the JPEG file, and unzip it as if it were a ZIP file, it unzips into the complete works of Shakespeare.

Here’s what the image looks like. I stripped out the Shakespeare stuff, because I don’t want everyone who reads this post to have to download it.

He correctly claimed that the hidden content “survives all of Twitter’s scaling, compression, and thumbnailing”. He also said “/how/ is left as an exercise to the reader”.

How impressive is this? Creating a hybrid ZIP file can be quite easy. To make a ZIP file, you only need to control some data near the end of the file. A lot of formats, including JPEG, will still work fine if you append random junk to the end of them. So you can pretty much just concatenate JPEG and ZIP data together, and get a hybrid file that works as either format. But there are a couple of problems:

To survive Twitter’s filtering, the custom data needs to be inside the main part of the JPEG file, not appended to it. And that could still be easy, except:

Leave a Comment