Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE help me solve this with details Examine the code below. Answer the questions that follow. alphabet=abcdefghijklmnopqrstuvwxyz def encrypt(plaintext): ciphertext= for i in range (,
PLEASE help me solve this with details
Examine the code below. Answer the questions that follow. alphabet="abcdefghijklmnopqrstuvwxyz" def encrypt(plaintext): ciphertext="" for i in range (, len(plaintext)): for j in range( (0, len(alphabet ) ): if plaintext [i]==alphabet [j]: ciphertext+=alphabet [(j+3)%26] print("Encrypted Message:", ciphertext) You may find it useful to run the code before attempting the questions. 1. Modify the encryption function to allow the user to enter any shift key to encrypt their message. 2. Create a function called 'decrypt' that accepts ciphertext and the shift key from the user and then decrypts the ciphertext. 3. Create a function called 'bruteforce' that will accept ciphertext from the user and perform a brute force attack to decrypt the message. Your function must use the previously created decryption function to achieve this. 4. Save your work in a single Python (.py) file: cse1202_firstname_lastname_USI_lab1.py Note: You cannot use library functions to answer these questionsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started