########### CSC 15 Lab 7b ## This lab and lab7 are due by 2:20pm on Thursday 11/14 (firm) ## In this addendum to lab 7, you will decrypt a file (the sample # solution to this lab) that's been encrypted in the same way as # lab7, except a permutation was also applied to the final, encrypted # form of the ascii string. # Replace 'lab7' below with the filename prefix of your solution to lab 7: from lab7 import * # this imports all definitions from lab7.py, # On the class homepage you will find two files, solution2.encP, which is # the encrypted file that you're supposed to decrypt, and solution2.perm, # which is a (unencrypted) permutation array. The following code # reads in this array and assigns it to Perm: import json fd = open("solution2.perm") Perm = json.load(fd) fd.close() #print(Perm) # make sure you got it #### The following are some of the code that I used to produce the # encrypted file. However, this time, like most of you, I neglected # to write enough comments for much of the code (HA!). You will have # to figure out what parts of the code is pertinent to the assignment # and write your own code to decrypt the file. The decrypted program # will have more comments. def isperm(P): n = len(P) Cnt = [0]*n answer = True i = 0 while answer and i=n: answer=False else: Cnt[P[i]] += 1 i += 1 i = 0 while answer and i