This is a substitution cypher Each letter is replaced by another letter with no repetition Ignore spaces and punctuation You must account for spaces (I ignored them, but there are other legitimate responses.) The best program will also account for punctuation and other symbols. (Ignoring them is fine.) Your program can ignore these special characters when they occur, but it should not crash if it encounters a strange character. Manage Capitalization In most cryptographic applications, all letters are converted to uppercase. Please follow this convention or deal with potential case conversion problems in another way. Use Functions You may not make significant changes to the main function. Determine which functions are necessary and create

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...
icon
Related questions
Question

This is a substitution cypher
Each letter is replaced by another letter with no repetition
Ignore spaces and punctuation
You must account for spaces (I ignored them, but there are other legitimate responses.)
The best program will also account for punctuation and other symbols. (Ignoring them is fine.) Your program can ignore these special characters when they occur, but it should not crash if it encounters a strange character.
Manage Capitalization
In most cryptographic applications, all letters are converted to uppercase. Please follow this convention or deal with potential case conversion problems in another way.
Use Functions
You may not make significant changes to the main function. Determine which functions are necessary and create them. (The blackbelt project does allow for one slight modification, noted below.) Do not turn in a program with only a main() function!! Write the code necessary for Python to run the main function as expected
Pass data between functions
Your functions may require some input and return some output. Part of the task is to determine how the methods are to be created.
Using a key
There's several workable answers, but I used a string with all the alphabet characters and a second string with a "scrambled" version of the alphabet.
Useful String methods
This program is all about string manipulation, so you may want to use help("str") in your python shell to look up some useful techniques. Here are a few things you might need to know how to do:
determine the length of a string
convert a string to upper case
find the position of a character in a string
Determine the character at a certain position in a string 

 

 

Create a program that assists in a basic form of cryptography, a substitution cypher. Write a program that will accept a phrase and convert it into code by substituting
letters according to a key.
This program will also be an example of functions. You will be given a main function body. This function refers to a number of other functions which you will have to
create. It's part of your job to figure out how these functions should be created and what their parameters and output should be.
The program is based on a standard text-based menu. You'Ill need to create methods (function) to display the menu, get input from it, and handle the details. Your
program should encrypt and decrypt messages.
Sample Run
Here's a sample run of the basic program in action.
SECRET DECODER MENU
0) Quit
1) Encode
2) Decode
What is your choice: 1
text to be encoded: Python Rocks!
AQULEWKEMNJ
SECRET DECODER MENU
0) Quit
1) Encode
2) Decode
What is your choice: 2
code to be decyphered: AQULEWKEMNJ
ΡΥTHONROCKS
SECRET DECODER MENU
0) Quit
1) Encode
2) Decode
What is your choice: 0
Thanks for doing secret spy stuff with me.
Transcribed Image Text:Create a program that assists in a basic form of cryptography, a substitution cypher. Write a program that will accept a phrase and convert it into code by substituting letters according to a key. This program will also be an example of functions. You will be given a main function body. This function refers to a number of other functions which you will have to create. It's part of your job to figure out how these functions should be created and what their parameters and output should be. The program is based on a standard text-based menu. You'Ill need to create methods (function) to display the menu, get input from it, and handle the details. Your program should encrypt and decrypt messages. Sample Run Here's a sample run of the basic program in action. SECRET DECODER MENU 0) Quit 1) Encode 2) Decode What is your choice: 1 text to be encoded: Python Rocks! AQULEWKEMNJ SECRET DECODER MENU 0) Quit 1) Encode 2) Decode What is your choice: 2 code to be decyphered: AQULEWKEMNJ ΡΥTHONROCKS SECRET DECODER MENU 0) Quit 1) Encode 2) Decode What is your choice: 0 Thanks for doing secret spy stuff with me.
Starter Code
You may copy and paste the following code into your editor to get started. You may also type the code by hand, but your main method must be identical to the one
posted here:
crypto.py
Implements a simple substitution cypher
II IIII
(alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
key
"XPMGTDHLYONZBWEARKJUFSCIQV".
def main():
keepGoing = True
while keepGoing:
response = menu()
if response ==
"1":
plain = input("text to be encoded: ")
print(encode(plain))
elif response == "2":
coded = input("code to be decyphered: ")
print (decode(coded))
elif response == "0":
print ("Thanks for doing secret spy stuff with me.")
keepGoing = False
else:
print ("I don't know what you want to do...")
#my starter code.
if name_ ==
__main__":
main()
Transcribed Image Text:Starter Code You may copy and paste the following code into your editor to get started. You may also type the code by hand, but your main method must be identical to the one posted here: crypto.py Implements a simple substitution cypher II IIII (alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" key "XPMGTDHLYONZBWEARKJUFSCIQV". def main(): keepGoing = True while keepGoing: response = menu() if response == "1": plain = input("text to be encoded: ") print(encode(plain)) elif response == "2": coded = input("code to be decyphered: ") print (decode(coded)) elif response == "0": print ("Thanks for doing secret spy stuff with me.") keepGoing = False else: print ("I don't know what you want to do...") #my starter code. if name_ == __main__": main()
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY