Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

Example input/output

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago