Question: Encrypt The first program you will write should be named encrypt.py. The job of this program will be to encrypt, mix, the lines of a



Encrypt The first program you will write should be named encrypt.py. The job of this program will be to encrypt, "mix", the lines of a text file, but do it in such a way that it can be un-done later with a separate program which you will also write) When you run your program, your program will first request a file to to encrypt. Requesting the file name will look like: Enter the name of a file to encrypt: X The program will then run its encrypting algorithm on the file X. It will then save the encrypted version of the program to a file named encrypted.txt. You might be wondering how the encryption works and how can I mix in such a way that it can be undone by another program? Your program will "mix" an input file by randomly re-arranging the lines of the input file. For example, you might request that encrypt.py python file named get_credentials.py that looks like #get the username from a prompt username = raw_input(''Login : >> ") #11st of allowed users user1"Luke" user2 "Leia" #control that the user belongs to the list of allowed users if usernameuser1: print ("Access granted") print ("Welcome to the system") print ("Access denied") elif usernameuser2: else: You then run encrypt.py and request that it mix this file Enter the name of a file to encrypt: get-credentials. py
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
