Skip to content

Encode textual data into QR codes, compile these codes into visual formats (video and GIF), and then decode them back to the original text.

Notifications You must be signed in to change notification settings

txtatech/qr-weaver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qr-weaver

This Is A QR Code Data Transmission Project

Overview

This project consists of a set of Python scripts designed to encode textual data into QR codes, compile these codes into visual formats (video and GIF), and then decode them back to the original text. It showcases a method for data encoding, transmission, and decoding using QR codes.

Components

The project includes three main Python scripts:

  1. qr_weaver_vid.py
  2. qr_weaver_gif.py
  3. qr_weaver_decode.py

qr_weaver_vid.py

Purpose:

This script encodes textual data into a series of QR codes, saves them as images, and compiles these images into a video.

Functionality:

  • Reads and compresses textual data from a file (test.txt).
  • Encodes the compressed data in base64 format.
  • Splits the encoded data into chunks.
  • Generates QR codes for each data chunk and saves them as PNG images.
  • Compiles the QR code images into a video using ffmpeg.

Dependencies:

  • Python 3
  • OpenCV (cv2)
  • numpy
  • qrcode
  • gzip
  • base64
  • os
  • json

qr_weaver_gif.py

Purpose:

Converts the series of QR code images into an animated GIF.

Functionality:

  • Reads the QR code images saved by qr_weaver_vid.py.
  • Converts each image to a consistent size and format.
  • Compiles these images into an animated GIF.

Dependencies:

  • Python 3
  • PIL (Python Imaging Library)

qr_weaver_decode.py

Purpose:

Decodes the QR codes from the animated GIF (generated by qr_weaver_gif.py) and reconstructs the original textual data.

Functionality:

  • Reads the animated GIF.
  • Extracts and decodes the QR codes from each frame.
  • Concatenates the decoded base64 data chunks.
  • Decompresses the data using gzip.
  • Writes the original textual data to a file.

Dependencies:

  • Python 3
  • OpenCV (cv2)
  • numpy
  • pyzbar
  • base64
  • gzip

Usage

The scripts should be executed in the following order:

  1. Run qr_weaver_vid.py to generate QR code images and a video from test.txt.
  2. Run qr_weaver_gif.py to create an animated GIF from the QR code images.
  3. Run qr_weaver_decode.py to decode the QR codes and reconstruct the original text.

Application

This project can be used for:

  • Secure and novel methods of data transmission where conventional methods are not feasible.
  • Educational purposes to demonstrate the use of QR codes in data encoding and decoding.
  • Experimental data storage and retrieval systems.

Requirements

  • Python 3.x
  • OpenCV (Python package cv2)
  • numpy
  • qrcode
  • PIL (Python Imaging Library)
  • pyzbar
  • gzip
  • base64
  • ffmpeg (for video generation)

Installation

  1. Ensure Python 3.x is installed.
  2. Install the required Python packages: opencv-python, numpy, qrcode, Pillow, pyzbar.
  3. Install ffmpeg for your system.

Limitations

  • The size of the textual data that can be encoded is limited by the QR code capacity and the number of frames in the video/GIF.
  • The speed of encoding and decoding is dependent on the processing power of the system used.

Potential Uses:

The process of encoding textual data into QR codes, compiling them into visual formats like video or GIF, and then decoding them back to text, can have several interesting applications:

  1. Secure Data Transmission: This method can be used for securely transmitting data. The QR codes can act as a medium to transfer information where conventional digital communication might be monitored or is unreliable. It's a unique way to encode and transport data securely, especially if combined with additional encryption before the QR code generation.

  2. Data Backup and Recovery: This approach can be used for backing up small amounts of critical data. For instance, important text documents can be converted to QR codes and stored visually. This could be particularly useful in scenarios where digital storage media might not be reliable over long periods.

  3. Educational and Experimental Use: For educational purposes, this project can demonstrate the concepts of data compression, encoding, and optical data transmission. It's a practical example of applying various computer science and data processing principles.

  4. Steganography: By embedding these QR codes in videos or GIFs, one could hide data in plain sight, which is a form of steganography. This could be used for artistic purposes or as an unconventional method of data hiding.

  5. Offline Data Transfer: This method could be useful in situations where internet access is limited or non-existent. Data can be transferred via printed QR codes or through visual mediums like videos played on screens, making it a versatile tool in offline environments.

  6. Cross-Media Data Transfer: For transferring data between different media types – such as from paper to digital or vice-versa – this method can be quite effective. It allows for a smooth transition between physical and digital formats.

  7. Emergency Situations: In emergency or disaster scenarios where traditional communication infrastructure is down, this method can be used to transmit important information via visual means like emergency broadcast videos.

Remember, the practicality of this method is influenced by factors like the size of the data, the resolution of the QR codes, the quality of the recording and scanning devices, and the environment in which the QR codes are displayed and scanned. The novelty and security of this method lie in its unconventional approach to data transmission.

MIT License

Copyright (c) 2024

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Encode textual data into QR codes, compile these codes into visual formats (video and GIF), and then decode them back to the original text.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published