Closed Rohit-Sharma-RS closed 1 month ago
Please share the screenshot of working, to get it merged. ⭐ Star this repos to get your PR merged faster! 🚀
Functional ss of this program
Please consider contributing to this repo: https://github.com/Ayu-hack/GeeksforGeeks-POTD-Solution Sorry for the inconvenience, and thank you for your understanding! 🙏
This pull request adds functionality to encrypt and decrypt messages using Morse code. The following features have been implemented:
Morse Code Dictionary:
A dictionary (
MORSE_CODE_DICT
) that maps each alphanumeric character and some punctuation to its corresponding Morse code representation.Encryption Function:
The
encrypt
function takes a message as input and converts it into Morse code. It handles invalid characters by notifying the user and excluding them from the output.Decryption Function:
The
decrypt
function converts Morse code back into human-readable text. It accounts for spaces to separate words and includes error handling for unrecognized Morse code symbols.User Interaction:
The program prompts the user to choose between encryption and decryption. If no input is provided, default messages are used for demonstration.
Usage
Improvements and Future Work
Testing
The code has been tested with various inputs to ensure both encryption and decryption functions operate correctly.