Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

=+ f. instituting laws against driving while intoxicated

Answered: 1 week ago