This Python program allows users to encrypt English phrases into Morse code and decrypt Morse code back into English phrases. It uses a dictionary mapping English characters and digits to their respective Morse code representations. The program handles both encryption and decryption, offering a simple and effective way to convert messages between English and Morse code.
-
Encryption: To encrypt an English phrase into Morse code, run the program and choose the option for encryption. Enter the English phrase, and the program will output the corresponding Morse code.
-
Decryption: To decrypt Morse code back into an English phrase, run the program and choose the option for decryption. Enter the Morse code (use spaces between letters and '/' between words), and the program will output the decrypted English phrase.
- Convert English phrases to Morse code.
- Convert Morse code to English phrases.
- Support for uppercase letters (A-Z), digits (0-9), and space (' ').
- Handles multiple words and special characters.
- User-friendly command-line interface.
- Clone the Repository:
git clone https://github.com/karimnagdii/Morse-Code.git cd morse-code-converter python morse_code.py
- Encryption Example:
Enter 'E' for encryption or 'D' for decryption: E Enter the English phrase to encrypt: Hello World Morse Code: .... . .-.. .-.. --- / .-- --- .-. .-.. -..
- Decryption Example:
Enter 'E' for encryption or 'D' for decryption: D Enter the Morse code to decrypt (use space between letters and '/' between words): .... . .-.. .-.. --- / .-- --- .-. .-.. -.. Decrypted Message: HELLO WORLD
Contributions are welcome! Please feel free to open issues or submit pull requests.
This project is licensed under the MIT License
The MIT License (MIT)
Copyright (c) 2023 karim amin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.