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
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
- 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
-
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.
- Clone the repository:
git clone https://github.com/theg1239/shogiencryption
- Install the dependencies:
pip install -r requirements.txt
- Run the
encode.py
script:
python encode.py <input_file> <output_kif_file>
- 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.
- Run the
decode.py
script:
python decode.py <input_kif_file> <output_file>
- 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.
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.