Permutation ciphers

Assignment Help Python Programming
Reference no: EM13163656

Permutation Ciphers (a.k.a. Transposition Ciphers) are another class of simple cryptosystems. For this we use the functions apply(.,.) and inv(.) from Homework 4; copy these two functions into your le as auxiliary functions.
(1.a) De ne a function encr(k,m), where the message m is any string over the characters a...zA...Z, and where the key k is a permutation. When len(m) is not a multiple of len(k) we append (a minimum number of) Z's to m to make len(m) a multiple of len(k). In the encryption, m is subdivided into successive chunks of length len(k), and the permutation k is applied to each chunk. The number of chunks is ceil(len(m)/len(k)).
(1.b) De ne a decryption function decr(k,c), which inverts the encryption. Here, c is any string over the characters a...zA...Z, such that len(c) is a multiple of len(k).
(1.c) As comments, answer the following:
Give the encryption of the following text, with key [3, 2, 4, 1, 0] :
'SineLaboreNihil'
Decrypt the following cipher with the key [6, 1, 0, 2, 7, 4, 5, 3]:
EAGLSIALDOTMIISNPIVSAINAATREMUNM

Reference no: EM13163656

Questions Cloud

Same directory as your program : In the same directory as your program, create a file FF1, and write into it Hello (with a space at teh end). Similarly, create a file FF2, and write into it world! (with a new line, i.e., an ENTER at the end). And create a file DD and write into i..
Multiple choice question on networking : 1-Which of the following extensions point to an executable string of code?
Write a function trans(m) which returns the transpose : Write a function trans(M) which returns the transpose of an n-by-n matrix M. The matrix M is represented by a list of n lists, each of length n. Transposing M means that each M[i][j] is swapped (once!) with M[j][i].
True or false about networking : 2- A print queue must be set up for every printer on the network served by a print server. True False
Permutation ciphers : Permutation Ciphers (a.k.a. Transposition Ciphers) are another class of simple cryptosystems. For this we use the functions apply(.,.) and inv(.) from Homework 4; copy these two functions into your le as auxiliary functions.
Function should return a dictionary : Write a function numOccur(s), where s is a string; the function should return a dictionary whose keys are the 26 ascii letters abcdefghijklmnopqrstuvwxyz
Recursion to write a python function : Use recursion to write a Python function depth(LL), where LL is a nested list of lists of lists etc. of numbers (i.e., oat and int) and strings. We want to return the depth of nesting, i.e., how often, maximally, there is a list in a list etc
Determine the values for m and l for the b+ tree : A B+-tree is to be stored on disk whose block size is 2048 bytes. The data records to be stored are 50 bytes, and their key is 4 bytes. Determine the values for M and L for the B+-tree. Assume pointers are 4 bytes each.
Let ll be a list of integers : Let LL be a list of integers. Use list comprehension to produce teh following lists. Each one should just take onel line. Anser questions as two comments.

Reviews

Write a Review

Python Programming Questions & Answers

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  The dictionary order based on the ascii order

Needless to say, the dictionary order based on the ASCII order is not what a real-world indexing software wants. So, we want to implement the dictionary order of strings in the standard wa

  Fill in the python code

Fill in the Python code to play Tic Tac Toe. I won't award points unless it runs succesfully. # Tic-Tac-Toe Game def drawBoard(board): # Draws the board using the list of numbers print(" ") print(" ",board[0]," | ",board[1]," | ", board[2]) print("--..

  Design a prgram using python

Design a prgram USING PYTHON that students can use to calculate what score they need on final exam to get a certan final grade for a course.

  Function should return a dictionary

Write a function numOccur(s), where s is a string; the function should return a dictionary whose keys are the 26 ascii letters abcdefghijklmnopqrstuvwxyz

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Most popular name would be the one with the biggest number

the program will ask you to insert the year that the user is interested in, then ask the gender that the user is interested in, and print out the most popular names corresponding to the year and gender. FYI, the number on the right represents how man..

  Data file is a comma separated

The data file is a comma separated text values stored in a file with '.CSV' extension. The file has five columns corresponding to employee data fields listed above.

  Cleint software so that it does not display

Rewrite the cleint software so that it does not display an echo of a message sent by the users. Maybe it means that each time a user tries to send a private message that same message is also sent back to them? summary: stop that from happening?

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Define a function to calculate the values

Be sure to define a function to calculate the values and print the table displaying the interest rate in the first column, the monthly payment in the second column, and the total payment in the third column. Your program should not allow the user to ..

  Project will be a simple, working program

This programming project will be a simple, working program, using Python language, which utilizes a good design process and includes:Sequential, selection, and repetitive programming statements as well as,At least one function call.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd