PA5 Decrypting a secret message

PA5: Decrypting a secret message In this assignment, you’ll decrypt a secret message using a cipher. A “cipher” is a program that converts a message in normal text into a secret message, and vice­versa. For example, the normal message “meet at five pm” might be converted to the secret message “[@@, !, (#<@ ][“ using a cipher. The secret message can be sent to a friend. Nobody else could read the message, expect the friend whose cipher would convert the secret message back to normal text. The starter program decrypts the first character in a secret message if that first character is ‘{‘. The complete list of cipher and normal characters to decrypt a message: ‘!’ ­> ‘a’ ‘^’ ­> ‘b’ ‘&’ ­> ‘c’ ‘*’ ­> ‘d’ ‘@’ ­> ‘e’ ‘(‘ ­> ‘f’ ‘)’ ­> ‘g’ ‘­’ ­> ‘h’ ‘#’ ­> ‘i’ ‘_’ ­> ‘j’ ‘=’ ­> ‘k’ ‘+’ ­> ‘l’ ‘[‘ ­> ‘m’ ‘{‘ ­> ‘n’ ‘$’ ­> ‘o’ ‘]’ ­> ‘p’ ‘}’ ­> ‘q’ ‘;’ ­> ‘r’ ‘:’ ­> ‘s’ ‘,’ ­> ‘t’ ‘%’ ­> ‘u’ ‘<‘ ­> ‘v’ ‘.’ ­> ‘w’ ‘>’ ­> ‘x’ ‘/’ ­> ‘y’ ‘?’ ­> ‘z’ 1) Decrypt by hand the following secret message: {#&@ Then, modify the program to decrypt all instances of ‘{‘ in the secret message to ‘n’. 2) Modify the program to decrypt all instances of 3 more decryptions: ‘&’ ­> ‘c’ ‘@’ ­> ‘e’ ‘#’ ­> ‘i’ Your program should decrypt the following secret message: {#&@ 3) Add the remaining 22 decryptions. Instead of coding 22 more branch statements, loop through the cipherV vector. Refer to the “Multiple vectors” section for an example of a program with two vectors. Here is an example program execution (user input is highlighted here for clarity): Enterasecretmessage:{#&@ Decryptedmessage:nice Here is an example program execution (user input is highlighted here for clarity): Enterasecretmessage:[@@,!,(#<@][ Decryptedmessage:meetatfivepm Here is an example program execution (user input is highlighted here for clarity): Enterasecretmessage:Y$%-!<@${&@!)!#{($#+@*[/]+!{: Decryptedmessage:Youhaveonceagainfoiledmyplans

 

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

<h5 style="

"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!":

Get started