1. We have defined a symmetric cryptography algorithm using the XOR operator. Assume our messages (before encryption) consist of only uppercase and lowercase letters, digits and blank character. In addition, assume the key size is only one byte which is an integer between 0 and 255 (inclusive). The pseudocode of the proposed encryption algorithm is as follows: Read the message // for example message=”Hi” Read the key // for example key=10 Cipher_text=[]  //an empty list for i=1 to len(message): Cipher_text= Cipher_text.append(XOR(message[i],key)) Return Cipher_text Assume XOR function, takes a character and the key, then returns the result of bitwise XOR of ASCII code of the letter with the key as an (one byte) integer. For example, if message=”Hi” and key=10, then we should first calculate the ASCCI code of “H” which is 72 and find the result of (72 XOR 10) which is 66. Then the ASCCI code of “i” is 105, so the result of (105 XOR 10) is 99. Thus the Cipher_text would be [66,99]. As another example, if message=”Hello World” and key=73 then Cipher_text=[1,44,37,37,38,105,30,38, 59,37, 45] a) Using the given algorithm, encrypt a massage as message=”firstname lastname”, replace the first name with any name and the lastname with any last name and show the message before encryption and then the encrypted message. To do so, assume the key is 53. To answer this question, you need to implement the algorithm (in any programming language). But just write down the encrypted message as the answer.  b)  Explain how we can decrypt the encrypted messages? Assume we have an encrypted message and the key. Write an algorithm (in pseudo code or in JS or C or C++ or Python programming languages) to describe the decryption process.  c)  Decrypt the following cipher text with the key=20 using your proposed algorithm in part (b). Cipher_text=[92,113,120,120,123,52,67,123,102,120,112,53]

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

1. We have defined a symmetric cryptography algorithm using the XOR operator. Assume our messages (before encryption) consist of only uppercase and lowercase letters, digits and blank character. In addition, assume the key size is only one byte which is an integer between 0 and 255 (inclusive). The pseudocode of the proposed encryption algorithm is as follows:

Read the message // for example message=”Hi”

Read the key // for example key=10

Cipher_text=[]  //an empty list

for i=1 to len(message):

Cipher_text= Cipher_text.append(XOR(message[i],key))

Return Cipher_text

Assume XOR function, takes a character and the key, then returns the result of bitwise XOR of ASCII code of the letter with the key as an (one byte) integer. For example, if message=”Hi” and key=10, then we should first calculate the ASCCI code of “H” which is 72 and find the result of (72 XOR 10) which is 66. Then the ASCCI code of “i” is 105, so the result of (105 XOR 10) is 99. Thus the Cipher_text would be [66,99]. As another example, if message=”Hello World” and key=73 then Cipher_text=[1,44,37,37,38,105,30,38, 59,37, 45]

a) Using the given algorithm, encrypt a massage as message=”firstname lastname”, replace the first name with any name and the lastname with any last name and show the message before encryption and then the encrypted message. To do so, assume the key is 53. To answer this question, you need to implement the algorithm (in any programming language). But just write down the encrypted message as the answer. 

b)  Explain how we can decrypt the encrypted messages? Assume we have an encrypted message and the key. Write an algorithm (in pseudo code or in JS or C or C++ or Python programming languages) to describe the decryption process. 

c)  Decrypt the following cipher text with the key=20 using your proposed algorithm in part (b). Cipher_text=[92,113,120,120,123,52,67,123,102,120,112,53] 

d)  One of your classmates claims that the proposed cryptography algorithm based on XOR is not secure and cipher texts can be easily decrypted even without having the key. Explain if you are agreeing or disagreeing with this classmate. Explain your reasons. 

e)  To improve the security of the algorithm, the encrypted message is shown as a single string. For example, if message=”Hi” and key=10, then Cipher_text=6699. As another example, if message=”Hello World” and key=73 then Cipher_text=1443737381053038593745. Explain what is the main problem with the improved version? 

Expert Solution
steps

Step by step

Solved in 5 steps with 4 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.
Similar questions
  • SEE MORE QUESTIONS
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