Question: Assignment: Part 1 (30 points): Write the code to generate a key. This requires using a random number generator. Youll need to import random at

Assignment: Part 1 (30 points): Write the code to generate a key. This requires using a random number generator. Youll need to import random at the top of your code. Then, in your code to get a random number, you would need to do the following: random.seed() num = random.randint(0,25) The first line forces the random number generator to actually randomize. The second line will pick a random number between 0 and 25 storing it in num. You dont want repeats so you will have to think about how you will choose letters from the original alphabet and concatenate them to the key string. Part 2 (40 points): Ask the user to enter a message, encrypt the message based on the key you used, and print the encrypted message to the screen. Part 3 (30 points): Ask the user to enter an encrypted message and a key. Write the code to decrypt the message based on the key the user provided.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!