Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON Please include explanation per line using the # symbol Cryptography is the science of making messages secure, of transforming readable messages into unreadable messages

PYTHON

Please include explanation per line using the # symbol

Cryptography is the science of making messages secure, of transforming readable messages into unreadable messages and back again. Messages that are unreadable are called cipher-text. The process of turning plaintext into cipher-text is called encryption. The reverse process of turning cipher-text into plaintext is called decryption.

One of the easiest ways to encrypt a message is to scramble the letters. For example, the word "apple" could be randomly transformed to "lapep." In fact, there are 120 different possible arrangements of the word "apple." However, if the encryption algorithm randomly scrambles the letters, the task of the decryption algorithm is pretty hard. Encryption and decryption algorithms must work together in some agreed upon way, with the encryption algorithm scrambling letters and the decryption algorithm unscrambling them.

A transposition cipher is one way to scramble the letters of a message. The cipher separates the message into two groups of characters: the first group composed of the even-numbered characters and the second group composed of the odd-numbered characters. To produce the cipher-text, the cipher puts together both groups; placing the group of the even-numbered characters first, followed by the group of odd-numbered characters. This encryption results in a string with the characters shuffled to new positions.

a) Writea python program that takes a message,encrypts the message as described above and returns the cipher-text.

b) Write a python program that takes as a cipher-text, decrypts the cipher-text as described above and returns the message.

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

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

ISBN: 0262660709, 978-0262660709

More Books

Students also viewed these Databases questions

Question

What is management growth? What are its factors

Answered: 1 week ago

Question

2. Why?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago