. 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)  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.  b)  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?

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 19PE
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)  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. 

b)  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 3 steps

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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning