A sımple scheme to encrypt text 1s as follows: You pick a keyword and remove duplicate letters from it. • Then you fill the keyword, and the remaining letters of the alphabet, into a 5 x 5 square. (Since there are only 25 squares, I and J are considered the same letter.) Here is such an arrangement with the keyword PLAYFAIR. PLAYF IRBCD EGHKM NO QST U V W X Z Python • To encrypt a letter pair, say AM, look at the rectangle with corners A and M: PLAYF IRBCD EGHKM NO QST U V W X Z The encoding of this pair is formed by looking at the other two corners of the rectangle, in this case, FH. If both letters happen to be in the same row or column, such as G0, simply swap the two letters. Decryption is done in the same way. Write a program that takes as command line argument the text file to be encrypted (the source file) the encryption keyword the program should read the source file, encrypt the contents scoring to the schema above and store the encrypted contents in a file with the same name as the source file followed by :".enc" for example if the source file named data.txt, the output file should be " data.txt.enc"

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
i need the answer quickly
Problem Description
A simple scheme to encrypt text is as follows:
You pick a keyword and remove duplicate letters from it.
• Then you fill the keyword, and the remaining letters of the alphabet, into a 5 x 5 square.
(Since there are only 25 squares, I and J are considered the same letter.)
Here is such an arrangement with the keyword PLAYFAIR.
PLAYF
IRBC D
Python
EGHKM
NOQST
U V W X Z
• To encrypt a letter pair, say AM, look at the rectangle with corners A and M:
PLAYF
IRBCD
EGHKM
NOQST
UV W X Z
The encoding of this pair is formed by looking at the other two corners of the rectangle, in
this case, FH. If both letters happen to be in the same row or column, such as GO, simply swap the
two letters. Decryption is done in the same way.
Write a program that takes as command line argument
the text file to be encrypted (the source file)
the encryption keyword
the program should
read the source file,
encrypt the contents scoring to the schema above and
store the encrypted contents in a file with the same name as the source file followed
by :".enc" for example if the source file named data txt, the output file should be "
data.txt.enc"
Transcribed Image Text:Problem Description A simple scheme to encrypt text is as follows: You pick a keyword and remove duplicate letters from it. • Then you fill the keyword, and the remaining letters of the alphabet, into a 5 x 5 square. (Since there are only 25 squares, I and J are considered the same letter.) Here is such an arrangement with the keyword PLAYFAIR. PLAYF IRBC D Python EGHKM NOQST U V W X Z • To encrypt a letter pair, say AM, look at the rectangle with corners A and M: PLAYF IRBCD EGHKM NOQST UV W X Z The encoding of this pair is formed by looking at the other two corners of the rectangle, in this case, FH. If both letters happen to be in the same row or column, such as GO, simply swap the two letters. Decryption is done in the same way. Write a program that takes as command line argument the text file to be encrypted (the source file) the encryption keyword the program should read the source file, encrypt the contents scoring to the schema above and store the encrypted contents in a file with the same name as the source file followed by :".enc" for example if the source file named data txt, the output file should be " data.txt.enc"
Expert Solution
steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Knowledge Booster
Public key encryption
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education