Skip to content

theg1239/shogiencryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shogi Encryption

A file encoding/decoding project using Shogi moves to represent bits of data. It encodes file data into Shogi KIF format, and decodes it back into the original file.


Table of Contents
  1. About
  2. Built With
  3. Usage
  4. Contributing

About

Shogi Encryption encodes a file's binary data into a series of legal Shogi moves. The project utilizes Shogi's game rules to represent bits, converting binary data into Shogi's KIF format (a move notation for Shogi). Each move corresponds to a sequence of bits, and the legal move pool is dynamically updated based on the state of the game. The decoded KIF file can be converted back into the original file by reversing the process. Based on Chess Encryption

Features

  • File Encoding: Converts any file into a series of Shogi moves encoded in KIF format.
  • File Decoding: Decodes the KIF file back to its original binary data.
  • Handling Skipped Bits: If certain bits cannot be encoded into moves, they are stored separately and reinserted during decoding

Built with

  • Python- Primary programming language.

  • python-shog - Python package to simulate Shogi moves and validate legal move states.

  • TQDM- Progress bar for tracking encoding/decoding progress.


Usage

Setup the project locally:

  1. Clone the repository:
git clone https://github.com/theg1239/shogiencryption
  1. Install the dependencies:
pip install -r requirements.txt

Encoding a file into Shogi .KIF format:

  1. Run the encode.py script:
python encode.py <input_file> <output_kif_file>
  1. The script will read the input file, encode the binary data into Shogi moves, and save the moves in KIF format to the output file. Any bits that cannot be encoded into moves will be saved as SKIPPED_BITS in the KIF file.

Decoding a .KIF file back into the original file:

  1. Run the decode.py script:
python decode.py <input_kif_file> <output_file>
  1. The script will read the KIF file, decode the Shogi moves back into binary data, and reconstruct the original file. Any skipped bits from the encoding process will be reinserted at the correct positions.

Contributing

Contributions to improve this project are welcome. If you have any suggestions or bug fixes, feel free to open a pull request. Your contributions will be reviewed and integrated into the project if they improve the functionality or structure.