A Python-based text encoder–decoder that applies custom string manipulation and reversible encoding logic. The program encodes user input using defined rules and decodes it back to its original form.
This project implements a rule-based text encoding and decoding system. The encoding process rearranges characters in the input string and adds randomized padding, while the decoding process accurately reverses the transformation to recover the original text.
The project focuses on strengthening understanding of string immutability, slicing, control flow, and logical reversibility in Python.
- Encode text using custom transformation rules
- Decode encoded text back to the original string
- Handles edge cases for short strings
- Menu-driven command-line interface
- Reversible and deterministic logic
- Python
- String manipulation
- Randomization (
randommodule)
- If the string length is less than 3:
- The string is reversed
- If the string length is greater than 3:
- The first character is removed and appended to the end
- Three random lowercase letters are added to the front
- Three different random lowercase letters are added to the back
- If the string length is less than 3:
- The string is reversed
- Otherwise:
- The first and last three random characters are removed
- The last character is moved back to the front to reconstruct the original string
- Clone the repository:
https://github.com/Arpitawork24/Text-Encoder-Decoder.git
- Navigate to the project directory: cd Text-Encoder-Decoder
- Run the program: python encoder_decoder.py