CSC 15 Lab 8b ------------------------------------------------------------------------------ For today's lab you are to do the following: 1. Finish Lab 7. For part 2, however, I've set up a network server you can download from. You need to use the code found in "client1.py" to contact the professor's computer running on a server. You will send the prof a message, and the prof will send you back a string, ENCRYPTED. You have to save it to a file, then decrypt the string. Use the lettermap.key file for the character map (permutation of size 128) 2. Below you will find some of the functions to convert between numbers and binary strings. At the end there is a function to pack a 16-character DNA sequence into a single 32-bit two's complement integer. You need to write the inverse function, which will convert the number back to a sequence consisting of 'A', 'C', 'G' and 'T'. # function to represent a non-negative integer as a string of size bits def binform(n,bits): # n is an int, returns string if (n> 2**bits-1 or n< -1 * 2**bits): raise Exception("not enough bits") s = "" # binary string to be built while n>0: d = n%2 # next digit from right end s = str(d) + s # construct s backwards n = n/2 # while n ## now sign-extend string to be of size bits s = "0"*(bits-len(s)) + s return s ## binform ## function to invert a string of bits def invertbits(s): # s is a string, returns string D = ['1','0'] # inversion map t = "" i = 0 while i=0: return binform(x,bits) else: return invertbits(binform(-x-1, bits)) ## twosform #print twosform(-4,3) # prints "100" ############### inverse operations ## convert string of bits to integer - non-negative only version def bitstonn(s): # s is string, returns int ax = 0 base = 2**(len(s)-1) i = 0 while i