Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi i need help with this. Please DON'T USE LOOPS. Thank you! Question 4. Encryption/decryption program Write a program which encrypts (or decrypts) a message.
Hi i need help with this. Please DON'T USE LOOPS. Thank you!
Question 4. Encryption/decryption program Write a program which encrypts (or decrypts) a message. The message is always 25 letters in length, Lines 2 and 3 of the code below ensure that the message is always 25 letters in length. message = "Pagg rm rfomieugisanrn tl" message = message * 25 message = message [0: 25] #Make sure the message length is exactly 25 Copy the above statements which initialise the message variable into your program. The program uses the following encryption method. Firstly the 25 letter message is broken up into five 5 letter words, i.e., a five by five square of letters. Then the message is recreated by going down the five by five square of letters from left to right. For example, the message "abcdefghijklmnopqrstuvwxy" is reshaped into five rows: abcde fghij klmno pqrst uvwxy and then the message is reconstructed going down each column starting from the first column to the last column: "afkpubglqvchmrwdinsxejoty" Write your program in a file named 'YourUsernameAlQ4.py', e.g., afer023A1Q4-py. Below are three example outputs from the completed program (using different values for the message variable). Your program must give the correct output in the same format as the outputs in the three examples below: Original mesSage: B l ntbidjhraaoiinyyslt! Enorypted messoge: Enjoy this brilliant day! Original mesSage: Meet at 11 in the library Enorypted mesSoge: Mo hbetiere n atl lr 1tiy Original message: Ma hbetiere n atl lr Itiy Enarypted message: Meet at 11 in the library Once you are happy that your program code executes correctly, copy all the program code into CodeRunner except for the initial statements which initialise the variables and press the 'Check button. -> Assignment 1 Section B (10 marks) For Question 5, submit your completed Python programs using the Assignment Dropbox: https://adb.auckland.ac.nz/Home/ IMPORTANT: Your program MUST include a docstring the top of the file (containing your name, your username and a correct description of the program) and your program MUST be named correctly (i.e., as stated in the question). Assignment OneStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started