Steganography and Conversion – Update 1

Over the past week and a half of research in steganography and conversion, I have been quite busy!

First, I devised and improved three separate methods of storing and retrieving digital data in video form. I used the Python scripting language to create these methods, since, although it is slow and clunky, it “just werks”, and I don’t have 5000 years to make a faster program in assembly or C work. Brief summaries of the storage methods I created follow:

  1. ASCII85 (or base85): This method converts a stream of bytes read from any digital file into a string of text, encoded with the ASCII85 standard. The ASCII85 standard encoding uses 86 printable characters; every five characters represent four bytes of binary data. I then devised a method to convert the ASCII85 string into successive images, with each character in the string represented by a 32-pixel square of a distinct color. I finally joined these images into a video.

    ASCII85 sample

    ASCII85 sample frame

  2. Hexadecimal (or base 16): This method is similar to the previous method, except that it uses hexadecimal encoding, rather than ASCII85 encoding. This means that there are only sixteen characters used in encoded strings, and only sixteen possible colors in the resultant images and videos (as opposed to 86).
    Hexadecimal sample

    Hexadecimal sample frame


  3. Binary (or base 2): This method converts a stream of bytes read from any digital file into a string of zeros and ones (i.e., “1001010100111”). Each “1” corresponds to a white square in the output video, and each “0” to a black square. This method produces the longest videos, but with the greatest possible fidelity, due to the extreme contrast between colors.

    Binary sample

    Binary sample frame

Retrieval of the data from videos encoded in these ways is a long, slow, and involved process, which I will briefly summarize here. First, pixels in each frame of the video are separated into groups of 1024 pixels. Each group of 1024 pixels represents the pixels in each 32-pixel square. The color values of the 1024 pixels are averaged together; the closest color to this average is chosen from a predefined palette, and the corresponding character (whether in ASCII85, hexadecimal, or binary) is added to a string. At the end of the retrieval process, this string is decoded from ASCII85, hexadecimal, or binary, and the resultant stream of bytes is written to an output file.

I designed these methods to produce videos that might be usable on such low-fidelity, analog media such as VHS tape. Due to VHS-specific foibles such as color bleed, frame-rate inconsistency, and interlacing, I voluntarily increased the size of the resultant videos by using 1024 pixels per character, and including a “control square” in the upper right-hand corner of each frame (which will help overcome frame-rate inconsistency). Furthermore, I greatly increased the time and complexity of the data retrieval process, in the hopes of getting more accurate retrieval by using averages and nearest matches. Despite these efforts, however, the ASCII85 method (using 86 distinct colors) failed spectacularly when even a small amount of jpeg compression was introduced. The hexadecimal method (using 16 distinct colors) was a little more robust, but the binary method (using only 2 distinct colors) seems like the only method that could possibly work on VHS.

I also received in the mail and tested various electronic equipment, such as a cassette deck, stereo receiver/amplifier, VCR, and myriad adapters to transfer media from my computer to analog storage and vice-versa. Although I am running into more equipment-related issues than I had anticipated, soon I will begin testing my data-to-video conversion methods on VHS tape.

In my next blog post, I will write about my method for converting (and compressing!) digital data into still image, and about my further efforts to attain digital fidelity on VHS.


  1. Tatiana says:

    This is great! I’m intrigued by the data retrieval process! Way to go!

  2. teramage says:

    Thank you!

Speak Your Mind