Question: in python Part I: The Up/Down Cipher: Encryption Algorithm (20 points) Write a function updown encrypt ) that takes the following arguments, in this order:










in python
Part I: The Up/Down Cipher: Encryption Algorithm (20 points) Write a function updown encrypt ) that takes the following arguments, in this order: plaintext: a plaintext string containing letters, digits and spaces that will be encrypted num rows: the number of rows that will be used in the encryption process Here's how the up/down cipher works. First, take a plaintext string and start drawing characters from it, placing the first num rows of characters into the first column of a grid from up to down. We assume here that the grid has num_rows rows in it. Then take the next num_rows characters, placing them into the second column of the grid in reverse order, from down to up. Continue in this fashion, drawing characters from the plaintext string until you run out of characters, alternating between placing them from up-to-down and down-to-up. With some arithmetic CSE 101 - Fall 2017 Homework #4 Page 1 you should be able to figure out exactly how many columns your grid will need to store all the characters from plaintext. As an example, suppose we want to encrypt the string ' ABCDEFGHIJKLMNOPORSTUVw' with num.rows 5. The characters would be placed into a grid as follows (the arrows indicate the direction that the letters are written to the grid) AJKTU BILSV CHMRW DGNQ EFOP If all characters from the plaintext are placed into the grid but the last column is incomplete, we fill the last column with % symbols: AJKTU BILSV CHMRW DGNQ% EFOP%
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
