1.13 LAB: Introduction to Cyptography (classes/constructors) Cryptography is the practice of encryption. Information Security uses cryptography techniques to encrypt and decrypt data. A simple encryption method might take plaintext and mix up the letters using some predetermined pattern and then use that pattern to decrypt the data for reading. Ciphers are the algorithms used to put the data into its secret pattern and then systematically decrypt it for reading. This script is going to use a famous simple cipher called the Caesar Cipher. It is a substitution cipher where each letter in the text is 'shifted' in a certain number of places. It uses the alphabet as the primary pattern and then based on the shift number, it would shift all the letters and replace the alphabet with our pattern. For example, if our shift number was 3, then A would be replaced with D, if we performed a right shift. As an example: Text = "THE CAT IS VISIBLE AT MIDNIGHT Ciphertext = "WKH FDW LV YLVLEOH DW PLGQLIJKW" !! The keys to decrypt this message are the shift number and the direction. The shift value can be any integer from 0-25. The above example uses shift = 3 and the shift direction is right or direction = 'r". Complete the cipherTest class by adding a constructor to initialize a cipher item. The constructor should initialize the shift to 0, and the direction to r for right shift If the constructor is called with a shift value, and direction, the constructor should assign each instance attribute with the appropriate parameter value. Complete the following TODO's: (1) create input for text, shift value, and direction (use lower()) to keepland r lower case (2) create a cipher item and use the constructor with the above input values (3) use control structures to call shifttoright() if direction is right and call shifttoleft if direction is left, Make sure you print out the return encrypted message inside the control structures. We can create the encrypted text by using the ord () function This function will return an integer that represents the Unicode code point of the character, Character are represented by different values for upp/er and lower case so an 'a returns the integer 97. By using the unicode value we can add and subtract our shift value represented by an integer The given program accepts as input a text string as our message to be encrypted, a shift value, and a direction of 1 for left and r for right. The program creates a cipher item using the input values. The progrem outputs ihe encrypted message based on the shift value and the direction provided. Ex: If the input is text = Cryptography is fun!, shift = 4 and direction =L The output is:
1.13 LAB: Introduction to Cyptography (classes/constructors) Cryptography is the practice of encryption. Information Security uses cryptography techniques to encrypt and decrypt data. A simple encryption method might take plaintext and mix up the letters using some predetermined pattern and then use that pattern to decrypt the data for reading. Ciphers are the algorithms used to put the data into its secret pattern and then systematically decrypt it for reading. This script is going to use a famous simple cipher called the Caesar Cipher. It is a substitution cipher where each letter in the text is 'shifted' in a certain number of places. It uses the alphabet as the primary pattern and then based on the shift number, it would shift all the letters and replace the alphabet with our pattern. For example, if our shift number was 3, then A would be replaced with D, if we performed a right shift. As an example: Text = "THE CAT IS VISIBLE AT MIDNIGHT Ciphertext = "WKH FDW LV YLVLEOH DW PLGQLIJKW" !! The keys to decrypt this message are the shift number and the direction. The shift value can be any integer from 0-25. The above example uses shift = 3 and the shift direction is right or direction = 'r". Complete the cipherTest class by adding a constructor to initialize a cipher item. The constructor should initialize the shift to 0, and the direction to r for right shift If the constructor is called with a shift value, and direction, the constructor should assign each instance attribute with the appropriate parameter value. Complete the following TODO's: (1) create input for text, shift value, and direction (use lower()) to keepland r lower case (2) create a cipher item and use the constructor with the above input values (3) use control structures to call shifttoright() if direction is right and call shifttoleft if direction is left, Make sure you print out the return encrypted message inside the control structures. We can create the encrypted text by using the ord () function This function will return an integer that represents the Unicode code point of the character, Character are represented by different values for upp/er and lower case so an 'a returns the integer 97. By using the unicode value we can add and subtract our shift value represented by an integer The given program accepts as input a text string as our message to be encrypted, a shift value, and a direction of 1 for left and r for right. The program creates a cipher item using the input values. The progrem outputs ihe encrypted message based on the shift value and the direction provided. Ex: If the input is text = Cryptography is fun!, shift = 4 and direction =L The output is:
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
Related questions
Question
![00
5
3.
它 ☆
My library > CYB/135: Object-Oriented Security Scripting home >
1.13: LAB: Introduction to Cyptography (classes/constructors)
yBooks
EzyBooks catalog
Help/FAQ 8 Ricky Orti
1.13 LAB: Introduction to Cyptography (classes/constructors)
Cryptography is the practice of encryption. Information Security uses cryptography techniques to encrypt and decrypt data. A simple
encryption method might take plaintext and mix up the letters using some predetermined pattern and then use that pattern to decrypt the
data for reading.
Ciphers are the algorithms used to put the data into its secret pattern and then systematically decrypt it for reading. This script is going to
use a famous simple cipher called the Caesar Cipher. It is a substitution cipher where each letter in the text is 'shifted' in a certain number
of places. It uses the alphabet as the primary pattern and then based on the shift number, it would shift all the letters and replace the
alphabet with our pattern.
For example, if our shift number was 3, then A would be replaced with D, if we performed à right shift. As an example:
Text = "THE CAT IS VISIBLE AT MIDNIGHT" Ciphertext = "WKH FDW LV YLVLEOH DW PLGQLIJKW"
The keys to decrypt this message are the shift number and the direction. The shift value can be any integer from 0 - 25. The above example
uses shift = 3 and the shift direction is right or direction = r.
Complete the CipherTest class by adding a constructor to initialize a cipher item. The constructor should initialize the shift to 0, and the
direction to 'r for right shift. If the constructor is called with a shift value, and direction, the constructor should assign each instance
attribute with the appropriate parameter value.
Complete the following TODO's (1) create input for text, shift value, and direction (use lower()) to keep I and r lower case (2) create a cipher
item and use the constructor with the above input values (3) use control structures to call shifttoright() if direction is right and call shifttoleft
if direction is left. Make sure you print out the return encrypted message inside the control structures
We can create the encrypted text by using the ord () function. This function will return an integer that represents the Unicode code point of
the character. Character are represented by different values for upp/er and lower case so an 'a returns the integer 97 By using the unicode
value we can add and subtract our shift value represented by an integer.
The given program accepts as input a text string as our message to be encrypted, a shift value and a direction of I for left and 'r for right.
The program creates a cipher item using the input values. The program outputs ibe enerypted message based on the shift value and the
direction provided.
Ex: If the input is text = "Cryptography is fun!", shift = 4, and direction = L
The output is:
prt sc
sysrq
delete
insert
home
pause
break
f12
f8
LLJ
64
OLJ
91
S5
因
4
X
backspace
num Ik
scr Ik
6
O
P.
enter
7.
H.
WN
416](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F13db1b7d-0a21-4c2c-90f2-82e5bdab2f44%2F95e9f1bf-5d7e-4a1b-9425-fa335dea9379%2Fziire7s_processed.jpeg&w=3840&q=75)
Transcribed Image Text:00
5
3.
它 ☆
My library > CYB/135: Object-Oriented Security Scripting home >
1.13: LAB: Introduction to Cyptography (classes/constructors)
yBooks
EzyBooks catalog
Help/FAQ 8 Ricky Orti
1.13 LAB: Introduction to Cyptography (classes/constructors)
Cryptography is the practice of encryption. Information Security uses cryptography techniques to encrypt and decrypt data. A simple
encryption method might take plaintext and mix up the letters using some predetermined pattern and then use that pattern to decrypt the
data for reading.
Ciphers are the algorithms used to put the data into its secret pattern and then systematically decrypt it for reading. This script is going to
use a famous simple cipher called the Caesar Cipher. It is a substitution cipher where each letter in the text is 'shifted' in a certain number
of places. It uses the alphabet as the primary pattern and then based on the shift number, it would shift all the letters and replace the
alphabet with our pattern.
For example, if our shift number was 3, then A would be replaced with D, if we performed à right shift. As an example:
Text = "THE CAT IS VISIBLE AT MIDNIGHT" Ciphertext = "WKH FDW LV YLVLEOH DW PLGQLIJKW"
The keys to decrypt this message are the shift number and the direction. The shift value can be any integer from 0 - 25. The above example
uses shift = 3 and the shift direction is right or direction = r.
Complete the CipherTest class by adding a constructor to initialize a cipher item. The constructor should initialize the shift to 0, and the
direction to 'r for right shift. If the constructor is called with a shift value, and direction, the constructor should assign each instance
attribute with the appropriate parameter value.
Complete the following TODO's (1) create input for text, shift value, and direction (use lower()) to keep I and r lower case (2) create a cipher
item and use the constructor with the above input values (3) use control structures to call shifttoright() if direction is right and call shifttoleft
if direction is left. Make sure you print out the return encrypted message inside the control structures
We can create the encrypted text by using the ord () function. This function will return an integer that represents the Unicode code point of
the character. Character are represented by different values for upp/er and lower case so an 'a returns the integer 97 By using the unicode
value we can add and subtract our shift value represented by an integer.
The given program accepts as input a text string as our message to be encrypted, a shift value and a direction of I for left and 'r for right.
The program creates a cipher item using the input values. The program outputs ibe enerypted message based on the shift value and the
direction provided.
Ex: If the input is text = "Cryptography is fun!", shift = 4, and direction = L
The output is:
prt sc
sysrq
delete
insert
home
pause
break
f12
f8
LLJ
64
OLJ
91
S5
因
4
X
backspace
num Ik
scr Ik
6
O
P.
enter
7.
H.
WN
416
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education