Question: This is a C++ code, expect a thumbs up once you're finished! Task Some information on the Internet may be encrypted with a simple algorithm
This is a C++ code, expect a thumbs up once you're finished!



Task Some information on the Internet may be encrypted with a simple algorithm known as rot13, which rotates each character by 13 positions in the alphabet. A rot13 cryptogram is a message or word in which each letter is replaced with another letter that comes from a position in the alphabet moved from the original letter position at a constant displacement value, e.g. 13 letters forward. rot13 is an example of symmetric key encryption. For example, the string the bird was named squawk might be scrambled to form cin vrjs otz ethns zxqtop Details 1. Write missing method implementations for the class Rot13 that get a functional ROT13 cipher. 2. The input plain or encrypted message string is placed into the Rot13 object during the initialization. The input string may only contain Latin lowercase letters and spaces. You must check if the input string is valid before storing the input in the text field. If the input is invalid, the text field must be left empty. 3. Overload the bang operator ! to check if the Rot13 object is correctly initialized, and contains a non-empty message. The operator returns true if the message is empty. 4. Overload the stream extraction operator >> for the Rot13 class to perform rot13 encryption. The operator has to be implemented as a member function with a (modifiable) string reference parameter which is used to store an encrypted message. Encrypt the message stored in the string field text , and place it in the method reference parameter. The encryption procedure replaces every occurrence of the character with the character 13 steps forward in the alphabet (in a circular way). For example, a with n , b with o, and x with k, and so on. Spaces are not scrambled. Use static_cast > operator to transform characters into numbers which would allow to perform rotation transformation using addition/subtraction operations. . You can find numerical codes for letters in ASCII Table 5. Overload the insertion operator
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
