For this task, you are to write a cipher program to encrypt or…

Question Answered step-by-step For this task, you are to write a cipher program to encrypt or… For this task, you are to write a cipher program to encrypt or decrypt the given text message (strings). The cipher algorithm uses the pre-defined key and rules to convert the original text message (strings) into a ciphertext (strings). Specifically, the rules use the key to replace each letter of the original text message by another letter. A very simple set of rules is to replace letter a with letter z, letter b with letter y, letter c with letter x, letter d with letter w, …, etc. For this task, you should use the following keykey =’xznlwebgjhqdyvtkfuompciasr’Based on the above key, letter a should be replaced by letter x, letter b should be replaced by letter z, letter c should be replaced by letter n, …, and so on.Your task is to write the following functions:The encrypting function which accepts a list of strings and converts it into ciphertext (strings).The decrypting function which accepts a list of ciphertext (strings) and retuns it back to the original strings.The menu (options) function which display the available options for the user to select:The main function which involves the following:The key and any other parameters, variables, …etc (if needed)The input function to get input from userA loop of menu (or options) which asks the user to select either the Encrypting function, the Decrypting function or exit. The loop (menu) should be repeated unless the user selects exit option.           `E: Encrypting function`          `D: Decrypting function`          `EX: exit`           To achieve full marks for this task, you must follow the instructions above when writing your solution. Additionally, your solution must adhere to the following requirements:You must print the result of the Encrypting function (ciphertext) and Decrypting function (original strings) inside the main function.You must address the scenario when an empty list is passed in as argument to your function. The main function should ask the user that the input should be non-empty strings.You must not add any code outside the main function.Example RunsRun 1Enter a message: helloSelect OptionsE: Encrypting functionD: Decrypting functionEX: exitEThe Encrypted message is: gwddt`Select Options`E: Encrypting functionD: Decrypting functionEX: exitexRun 2Enter a message: The input message should be non-empty stringEnter a message: The input message should be non-empty stringEnter a message: CSE4IPSelect OptionsE: Encrypting functionD: Decrypting functionEX: exitEThe Encrypted message is: now4jkSelect OptionsE: Encrypting functionD: Decrypting functionEX: exitDThe Decrypted message is: CSE4IPSelect OptionsE: Encrypting functionD: Decrypting functionEX: exitEXRun 3Enter a message: The input message should be non-emptEnter a message: now4jk o1 2022Select OptionsE: Encrypting functionD: Decrypting functionEX: exitdThe Decrypted message is: CSE4IP S1 2022Select OptionsE: Encrypting functionD: Decrypting functionEX: exitEXRun 4Enter a message: csE4iP @ LtUSelect OptionsE: Encrypting functionD: Decrypting functionEX: exiteThe Encrypted message is: now4jk @ dmpSelect OptionsE: Encrypting functionD: Decrypting functionEX: exitexYour code should execute as closely as possible to the example runs above. To check for correctness, ensure that your program gives the same outputs as in the examples, as well as trying it with other inputs. Computer Science Engineering & Technology Python Programming CSE 1001 Share QuestionEmailCopy link Comments (0)