Skip to content

bytegen-dev/text-to-cipher

Repository files navigation

Text-to-Code Converter

A Python application for encoding and decoding text using 7 different ciphers with both web interface (Streamlit) and CLI support.

image

Features

  • 7 Ciphers: Morse Code, Semaphore, Braille, Binary, Caesar, Pigpen, and ASCII
  • Bidirectional: Encode text to cipher or decode cipher to text
  • Visual Export: Generate PNG images showing cipher representations
  • Batch Processing: Process multiple texts from CSV/TXT files
  • Web Interface: Modern Streamlit-based UI
  • CLI Support: Command-line interface for automation

Quick Start

Installation

pip install -r requirements.txt

Web Interface

streamlit run app.py

CLI Usage

# Encode text with Morse code
python cli.py Morse encode "Hello World"

# Decode Caesar cipher with custom shift
python cli.py Caesar decode "KHOOR" --shift 3

# Generate visual output
python cli.py Binary encode "ABC" --visual --output result.txt

Supported Ciphers

Cipher Description Example
Morse Dots and dashes A → •–
Semaphore Flag positions A → 1,1
Braille Unicode Braille A → ⠁
Binary 8-bit ASCII A → 01000001
Caesar Letter shift A+3 → D
Pigpen Grid symbols A → ┌─
ASCII Numeric values A → 65

Project Structure

code-weaver-prompt/
├── app.py              # Streamlit web interface
├── cli.py              # Command-line interface
├── requirements.txt    # Dependencies
├── ciphers/           # Cipher implementations
│   ├── __init__.py
│   ├── base.py        # Base cipher class
│   ├── factory.py     # Cipher factory
│   ├── morse.py       # Morse code
│   ├── binary.py      # Binary cipher
│   ├── caesar.py      # Caesar cipher
│   ├── braille.py     # Braille cipher
│   ├── semaphore.py   # Semaphore flags
│   └── pigpen.py      # Pigpen cipher
└── README.md

Development

The project uses an object-oriented architecture with:

  • BaseCipher: Abstract base class with common functionality
  • CipherFactory: Registry pattern for cipher management
  • Individual Ciphers: Each cipher implements encode/decode/visual methods
  • Streamlit UI: Reactive web interface with real-time preview
  • Pillow: Image generation for visual exports

License

MIT License

About

python application for encoding and decoding text using ciphers. includes web interface (Streamlit) and CLI support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors