Skip to content

ewarggg776/ToneCrypt

Repository files navigation

ToneCrypt

Python License Version

ToneCrypt is a Python-based tool that encrypts folders into WAV audio files using pitch shifts, noise, and reverb, with tones encoding decryption keys via a nonlinear equation [cos(f1/200)*f2^3 + log(f3+1)*exp(f2/500) + sin(f1/f3)]. It supports decryption from audio files, microphone recordings, or CDs, with Reed-Solomon error correction for robust folder restoration. This project is licensed under the GNU General Public License v3.0.


Features

  • Audio-Based Encryption: Convert folders or .zip files to WAV files with customizable pitch shifts and noise levels.
  • Flexible Decryption: Decrypt from WAV files, microphone input, or CD audio. Supports restoring folders or .zip files.
  • Secure Key Derivation: Uses SHA-256 to derive encryption parameters from a user-provided key.
  • Error Correction: Implements Reed-Solomon encoding for reliable data recovery.
  • Interactive & CLI Modes: Supports both interactive prompts and command-line arguments.

Installation

Option 1: Install via .deb Package

  1. Build or Download the Package:

    • To build: see the section below on building the .deb package.
    • Or download tonecrypt_1.0-1.deb from the Releases page.
  2. Install System Dependencies:

    sudo apt-get update
    sudo apt-get install python3 python3-pip libsndfile1 ffmpeg wodim cdparanoia alsa-utils
  3. Install the Package:

    sudo dpkg -i tonecrypt_1.0-1.deb
  4. Run ToneCrypt:

    python3 /usr/local/bin/ToneCrypt.py

    (Or add a symlink to your PATH for convenience.)

Option 2: Install as a Python Package

  1. Clone the Repository:

    git clone https://github.com/ewarggg776/tonecrypt.git
    cd tonecrypt
  2. Install System Dependencies:

    sudo apt-get update
    sudo apt-get install python3 python3-pip libsndfile1 ffmpeg wodim cdparanoia alsa-utils
  3. Install Python Dependencies:

    pip3 install -r requirements.txt
  4. Run Directly:

    python3 tonecrypt.py

Usage

Interactive Mode (with Color & Verbosity)

Run python3 ToneCrypt.py (or the installed /usr/local/bin/ToneCrypt.py) with no arguments to enter interactive mode:

python3 ToneCrypt.py

Features:

  • Colorful, user-friendly prompts
  • Toggle verbose/debug output with V at the menu
  • Choose encrypt or decrypt, and follow the prompts
  • Supports both folders and .zip files for encryption and decryption

Command-Line Mode

You can also use command-line arguments:

# Encrypt a folder:
python3 ToneCrypt.py --mode encrypt --input my_folder --output encrypted.wav --key mysecret --noise 0.1
# Encrypt a .zip file:
python3 ToneCrypt.py --mode encrypt --input my_archive.zip --output encrypted.wav --key mysecret
# Decrypt to a folder:
python3 ToneCrypt.py --mode decrypt --input encrypted.wav --output restored_folder --key mysecret
# Decrypt to a .zip file:
python3 ToneCrypt.py --mode decrypt --input encrypted.wav --output restored.zip --key mysecret

Examples

  1. Encrypt a Folder:

    mkdir -p test_folder/subdir
    echo "Hello" > test_folder/test.txt
    echo "World" > test_folder/subdir/subtest.txt
    python3 ToneCrypt.py --mode encrypt --input test_folder --output encrypted.wav --key mysecret
  2. Encrypt a .zip File:

    zip -r mydata.zip test_folder
    python3 ToneCrypt.py --mode encrypt --input mydata.zip --output encrypted.wav --key mysecret
  3. Decrypt to a Folder:

    python3 ToneCrypt.py --mode decrypt --input encrypted.wav --output restored_folder --key mysecret
  4. Decrypt to a .zip File:

    python3 ToneCrypt.py --mode decrypt --input encrypted.wav --output restored.zip --key mysecret
    # Then unzip restored.zip
    unzip restored.zip -d restored_folder
  5. Decrypt from Microphone:

    python3 ToneCrypt.py

    Choose decrypt, select mic, and follow prompts.


Building the .deb Package

To build the .deb package locally:

dpkg-deb --build tonecrypt_1.0-1

This creates tonecrypt_1.0-1.deb in the current directory. Install it as shown above.


Dependencies

Type Dependencies
System python3 (>= 3.7), python3-pip, libsndfile1, ffmpeg, wodim, cdparanoia, alsa-utils
Python numpy, scipy, soundfile, librosa, reedsolo, colorama, pydub

Install Python dependencies:

pip3 install -r requirements.txt

License

This project is licensed under the GNU General Public License v3.0. You are free to use, modify, and distribute this software, provided that any derivative works are also licensed under GPL-3.0.


Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -m "Add your feature").
  4. Push to the branch (git push origin feature/your-feature).
  5. Open a Pull Request.

Please report issues or suggest improvements via the Issues page.


Troubleshooting

  • APT Lock Errors: If you encounter Could not get lock /var/lib/dpkg/lock-frontend:

    sudo rm /var/lib/dpkg/lock-frontend
    sudo dpkg --configure -a
    sudo apt-get install -f
  • Command Not Found: Ensure /usr/local/bin is in your PATH:

    echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc
    source ~/.bashrc
  • Python Dependency Errors: Reinstall dependencies:

    pip3 install --break-system-packages numpy scipy soundfile librosa reedsolo colorama pydub

For further assistance, open an issue on GitHub.

About

A folder encryption tool that converts data into sound for encoding on physical media

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published