Question: Transposition Cypher in Python question Example input/output A transposition cypher scrambles the letters of a message. As discussed in the text, we place the text

Transposition Cypher in Python question

Transposition Cypher in Python question Example input/output A transposition cypher scrambles the

Example input/output

letters of a message. As discussed in the text, we place the

A transposition cypher scrambles the letters of a message. As discussed in the text, we place the text in a matrix (using the arrays from the numpy module), and exchange the rows and the columns. Write the following six functions makematrix(s, shape) which creates a numpy array from a string with the given shape, - flatten (array) which flattens a numpy array, converting it into a list - permute_rows(array, neworder) which permutes the rows of a matrix. - permute_cols (array, neworder) which permutes the columns of a matrix. - transencode (s, shape) which converts a string into a matrix of the given shape, and random permutes both the rows and columns (using random.shuffle()). It returns a flattened string. - transdecode (s, shape, limit-4) which takes a string, permuted by transencode, and decodes it by brute force, trying all possible permutations, checking each one using wordsegment. It returns all possible strings of with more than limit-1 words def makematrix(s,shape): pass def flatten (array): pass def permute rows (arr, neworder): pass def permute cols (arr, neworder): pass def transencode(s, shape): pass def transdecode(s, shape, limit-4): pass A transposition cypher scrambles the letters of a message. As discussed in the text, we place the text in a matrix (using the arrays from the numpy module), and exchange the rows and the columns. Write the following six functions makematrix(s, shape) which creates a numpy array from a string with the given shape, - flatten (array) which flattens a numpy array, converting it into a list - permute_rows(array, neworder) which permutes the rows of a matrix. - permute_cols (array, neworder) which permutes the columns of a matrix. - transencode (s, shape) which converts a string into a matrix of the given shape, and random permutes both the rows and columns (using random.shuffle()). It returns a flattened string. - transdecode (s, shape, limit-4) which takes a string, permuted by transencode, and decodes it by brute force, trying all possible permutations, checking each one using wordsegment. It returns all possible strings of with more than limit-1 words def makematrix(s,shape): pass def flatten (array): pass def permute rows (arr, neworder): pass def permute cols (arr, neworder): pass def transencode(s, shape): pass def transdecode(s, shape, limit-4): pass

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!