Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Example input/output
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): passStep 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