KOMOREBI 木漏れ日

(canopy)

Turning free video hosting services into a file sharing platform by using qr codes and a little python

Duncan Andrews

September 2019

note: At the beginning of this project I could not find a similar project using video, though stenography is an old practice for sure so its likely I just didnt find it. Also this was originally written on a lightweight fairly unstable Kali distro. I’m having issues having it read the qr codes it generates, at least since I’ve switched systems, but I know that the data is being encoded. Also points of improvement and later features would include, stacked images or grid, command line arguments(duh), gif creation, encryption, and headers added to each final file made with length and information about file etc. Also I am not formally trained in programming so forgive any errr.. errors

    In the age of IOT and DRM and constant connectivity we sacrifice much of our privacy for the basic need of storing our data. There was a point in the early 21st century where the rush and expansion of the ability to have larger hard drives and more native storage space superseded many other options for personal computing. But as the ease of inter computer connectivity came into full realization and the internet became more accessible, many large corporations and governmental entities realized that by withholding these once standard options and instead selling storage space through proprietary and usually subscription services they were able to generate more capital, brand loyalty, and brand dependence. Additionally now many governments seek to install back doors into many of these major data hosting companies communications and storage networks. This begs the question for any person aware of these problems “How can keep we store our files or share them without unwanted alphabet agencies or subscription hosts invading our privacy?”. Well one method I’ve devised and created an engine for is taking the raw hex data (and if needed encrypt it) of any file and encoding pieces of it qr code images, then turning those images into slides of a video file(or .gif for text or email or static page hosting) and with the process reversed be able retrieve that information and reconstruct into the original file. Using this method and the program I’ve wrote, we gain the ability to take advantage of free video hosting sites throwing a digital judo move using those video hosting sites free services to host our files, whatever type, unchecked. Also if instead of a video, if the qr codes are stacked into an animated gif file, we’ve effectively made texting files and anonymous downloads possible(File size is of course a consideration in all this)

As borrowed from a business insider article from 2014 some off the major problems with relying on companies to host your files is as follows (https://www.businessnewsdaily.com/5215-dangers-cloud-computing.html)

So lets get into the nitty gritty of it and start by getting a few things explained, starting with stenography. Well what is steganography? Steganography is the practice of concealing a file, message, image, or video within another file, message, image, or video. The word steganography combines the Greek words steganos (στεγᾰνός), meaning "covered or concealed", and graphe (γραφή) meaning "writing". Now the qr codes we’ll be making are designed to recognized for storing information, but the arrangement of many of them in video format to the untrained eye is unexpected an novel. But you ask what is a qr code. Likelihood is you already know but if you didn't. QR code (abbreviated from Quick Response Code) is the trademark for a type of matrix barcode (or two-dimensional barcode) first designed in 1994 for the automotive industry in Japan. (You can find a qr code with the link to the GitHub on the first page of this document)

Qr codes have the ability to store a decent amount of data at least comparatively to stnder upc codes like the kind on our box of s=ceral.

Storage

The amount of data that can be stored in the QR code symbol depends on the datatype (mode, or input character set), version (1, ..., 40, indicating the overall dimensions of the symbol, i.e. 4 × version number + 17 dots on each side), and error correction level. The maximum storage capacities occur for version 40 and error correction level L (low).

Maximum character storage capacity (40-L)

character refers to individual values of the input mode/datatype

Input mode            

Max. characters

Bits/char.

Possible characters, default encoding            

Numeric only            

7,089

3⅓

0, 1, 2, 3, 4, 5, 6, 7, 8, 9            

Alphanumeric            

4,296

0–9, A–Z (upper-case only), space, $, %, *, +, -, .,             /, :            

Binary/byte            

2,953

8

ISO 8859-1            

Kanji/kana            

1,817

13

Shift JIS X 0208            

Staring the program

you can download program from (Link)

you will need some libraries installed most of them if not all are found at the beginning of the code

import time

subprocess

os

os.path

nmatch

qrcode

qrtools

binascii

cv2

numpy

moviepy.editor

run the program by using:

python QR.py

you'll be greeted with a menu of options as follows:

QR

__________________________________

1. Convert file to Hex

2. Fragment and encode Hex file to bank of QR images

3. Read indvidual QR image

4. Reassemble bank of QR images

5. Assemble video bank from QR bank

6. Assemble full video from video bank

7. Deconstruct video into QR bank

8. Restore file

9. Quit

Enter Choice:

note: you want to make sure whatever file you want to convert to qr video storage is in whatever folder you are launching this from. I HIGHLY SUGGEST you put this program in its own folder as it generates lots of image files.

Step 1: converting your file to hex

in order to divide the raw data of your file of choice we need to convert and save that file to a text file. Select “1.” by typing “1” and pressing enter. You will be show a list of all files in your working directory. You will be prompted for a file name, simply type in the file name with extension and hit enter. Next you will see the raw data of that file flood your screen into hexadecimal format. You've now just created a text file with all this data. The name of the text file is HEX + “whatever your file was” .txt

File HEXpizza.jpg made Succesfully!

Press Enter..

Step 2:Fragment and encode Hex file to bank of QR images

now that we have our hex data we need to break it up into sizes small enough to fit inside qr codes

Select option 2 by typing “2” and pressing enter. You will be shown a list of all .txt files in your working directory. Type in the name of your file with extension and press enter. You'll then be asked to name a folder for all the qr images to be put in, choose whatever name you like.

QR

__________________________________

----------Working Directory Files

Files:

HEXqr.txt

Enter File Name: HEXpizza.txt

Enter Directory name to create: box

Character lengh of HEXpizza.txt:

25694

Press Enter..

When you hit enter you'll be shown the count of character in the text file. Hit enter once more to start the actual creation of qr images from this data. This part I’m particular fond of watching for large files, but on the screen will be shown the actual pieces and chunks of data being encoded. You can also see the percent done. It should looks something like this.

Note: depending on your computer and file sizes this can take some time I suggest using a small file for your first try.

Percent Done: 97.29898030668638592667548844

Characters Processed: 25000 of 25694

Payload:

6e742822362e20417373656d626c652066756c6c20766964656f2066726f6d20766964656f2062616e6b22290a097072696e742822372e204465636f6e73747275637420766964656f20696e746f2051522062616e6b22290a20202020202020207072696e742822382e20526573746f72652066696c6522290a097072696e742822392e205175697422290a202020202020202063686f696365203d207261775f696e7075742822456e7465722043686f6963653a2022290a202020202020202069662063686f6963653a0a2020202020202020202020202020202069662063686f696365203d3d202731273a0a20202020202020202020202020202020202020202020202048657828290a2020202020202020202020202020202069662063686f696365203d3d202732273a0a20202020202020202020202020202020202020202020202051526d616b6528290a090969662063686f696365203d3d202733273a0a20202020202020202020202020202020202020202020202051527265616428290a0a2020202020202020202020202020202069662063686f696365203d3d202734273a0a2020202020202020202020202020202020202020202020205152617373656d626c6528290a090969662063686f696365203d3d202735273a0a2020202020202020202020202020202020202020

25

Percent Done: 100

Characters Processed: 25694 of 25694

Payload:

202020204d4d63726561746528290a090969662063686f696365203d3d202736273a0a090909436f6e28290a2020202020202020202020202020202069662063686f696365203d3d202737273a0a2020202020202020202020202020202020202020202020204d4d627265616b28290a2020202020202020202020202020202069662063686f696365203d3d202738273a0a20202020202020202020202020202020202020202020202048657832426928290a09202020202020202069662063686f696365203d3d202739273a0a2020202020202020202020202020202020202020202020205a697028290a2020202020202020202020202020202069662063686f696365203d3d202771273a0a09090942616e6e657228290a2020202020202020202020202020202020202020202020207175697428290a09656c73653a0a0909486f6d6528290a09486f6d6528290a0a486f6d6528290a0a0a

26

Finished

Press Enter..

when the screen stops scrolling and prompted hit enter. This will return you to the main menu. If you look in a file manager you should now see the folder you created populated with quite a few qr images, if you have a large file you can watch them being made!

Step 3: Assemble video bank from QR bank

Now that we have a folder full of qr images its time to make videos of them. You may ask “why not join them all at once?” well at the time of this wring my computers ram could not handle that much information in an array so by parsing it into smaller videos then into one large one, we can allow the program to run on older computers(like mine), this also allows for some error checking aswell.

Select option 5 by typing “5” and pressing enter. At this screen you'll be prompted for the folder name of where you have all the qr images. Type the name and hit enter to watch the magic happen. Video files are ten frames long. When this process is over hit enter to return to the main menu. If you look in your file manager, you should see some video files.

Step 4: 6. Assemble full video from video bank

now that we have our library of videos we need to join them.

Select option 5 by typing “5” and pressing enter. After a few moments (depending on file size) you should see the text finish moving and a prompt to press enter

CONGRATULATIONS!

    You've just turned whatever file you choose and whatever file type it was into a qr code slide representation .avi! You can now post this too your video hosting site of choice

QR

__________________________________

----------Working Directory Files

Files:

0.avi

2.avi

1.avi

output.avi

Enter File name to deconstruct: output.avi

Video Deconstructed!

Press Enter..

    from decimal import Decimal as D

    from pathlib import Path

2. drm and copyright

3, relying on other peoples storage and lack of privacy and paid maintaince

4 qr codes, history how they work

5. merging these ideas to take advangtage of a platform that wont go down

6. how I did it

steps and problems

7. results

8. things to fix and considerations

    encryption

    titleing

    use with youtube dl