Create a command-line tool that encodes and decodes text messages using emojis. This task combines elements of cryptography, Unicode handling, and command-line interface design using the click
library.
- Implement a simple substitution cipher using emojis as the cipher alphabet.
- Create a command-line interface using
click
for encoding and decoding messages. - Handle Unicode characters correctly to support a wide range of emojis.
- Python 3.7+
- click library
- emoji library
Install the required packages using:
pip install click emoji
Run the script with the following commands:
Encode a message:
python emojify.py encode "Your message here"
Decode a message:
python emojify.py decode "Your 😎 emoji 😊 message 😍 here"
- The tool accepts two main commands:
encode
anddecode
. - Encoding:
- Input: A plain text message
- Output: The message with each letter substituted by a unique emoji
- Decoding:
- Input: An emoji-encoded message
- Output: The original plain text message
- The emoji-to-letter mapping is consistent within a session but randomized between runs.
- Supports the 26 letters of the English alphabet (case-insensitive).
- Preserves spaces and punctuation in the original message.
- Add support for numbers and special characters. [2 points]
- Create a simple GUI to encode and decode using a framework like Tkinter or PyQt [5 points]
Happy emoji-ing! 🚀