n this problem, you will mple cipner thlat, instead of dividng the text mtO ouu characters, separates it into three sets of characters. As an example, we will use this 1977 quote by Digital Equipment Corp. president Ken Olson -- "There is no reason anyone would want a computer in their home." (Spaces are represented with the square u-like character.) There is no reason anyone would want a computer in their home. Rail 1: Rail 2: T r i n e d a e i t i h e a. u a u n h r Rail 3: e a n t m. Example three-rail transposition. The resulting encrypted text is produced by reading the text horizontally, i.e., adding the three rails: Rail 1 + Rail 2 + Rail 3 = **“Trinrs yeoda cpeitihehesoeoao u naournhro.e annnwlwt mt e m" (without the quotes). Requirements: mplement the three-rail transposition cipher above, placing your code in the file p4_2.py (template provided, replace comment at the beginning of the file with your own code). Feel free to develop your code in PyCharm or the DE of your choice, then upload or paste it into Coding Rooms. Because this is our first assignment here, just as a packup, also submit your python files through the Canvas assignment for Project 4. n your p4_1.py module, define the functions main(), encrypt(msg: str) → str and decrypt(msg: str) » str. You may define other functions as you see fit, but these three must match the interface specified here. • The encrypt function should take in the original text and use the three-rail encryption approach described above, returning the encrypted string. Include docstring with doctests. • The decrypt function should assume that the msg is already encrypted as described above, and decrypt it, returning the original text. Include docstring with doctests. • The main function should prompt the user for some input, then ask whether to encrypt or decrypt it, calling the appropriate function and printing the result
n this problem, you will mple cipner thlat, instead of dividng the text mtO ouu characters, separates it into three sets of characters. As an example, we will use this 1977 quote by Digital Equipment Corp. president Ken Olson -- "There is no reason anyone would want a computer in their home." (Spaces are represented with the square u-like character.) There is no reason anyone would want a computer in their home. Rail 1: Rail 2: T r i n e d a e i t i h e a. u a u n h r Rail 3: e a n t m. Example three-rail transposition. The resulting encrypted text is produced by reading the text horizontally, i.e., adding the three rails: Rail 1 + Rail 2 + Rail 3 = **“Trinrs yeoda cpeitihehesoeoao u naournhro.e annnwlwt mt e m" (without the quotes). Requirements: mplement the three-rail transposition cipher above, placing your code in the file p4_2.py (template provided, replace comment at the beginning of the file with your own code). Feel free to develop your code in PyCharm or the DE of your choice, then upload or paste it into Coding Rooms. Because this is our first assignment here, just as a packup, also submit your python files through the Canvas assignment for Project 4. n your p4_1.py module, define the functions main(), encrypt(msg: str) → str and decrypt(msg: str) » str. You may define other functions as you see fit, but these three must match the interface specified here. • The encrypt function should take in the original text and use the three-rail encryption approach described above, returning the encrypted string. Include docstring with doctests. • The decrypt function should assume that the msg is already encrypted as described above, and decrypt it, returning the original text. Include docstring with doctests. • The main function should prompt the user for some input, then ask whether to encrypt or decrypt it, calling the appropriate function and printing the result
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY