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

Please help! 

Please use at least two string functions of your choosing from chapter-10 (The book is Starting Out with C++ from Control Structures to Objects 9th Edition). Please read the encrypted code from an input file to save time. 

Thank you!

code for thr
ming Project 7 or 8 with no changes.
11. Your country is at war and your enemies are using a secret code to com
municate with each other. You have managed to intercept a message that
reads as follows:
:mmZ\dxZmx] Zpgy
The message is obviously encrypted using the enemy's secret code. You
have just learned that their encryption method is based upon the ASCII
in a string are encoded using this system. For example, the letter "A" is
code. Appendix 3 shows the ASCII character set. Individual characters
encoded using the number 65 and "B" is encoded using the number 66.
Your enemy's secret code takes each letter of the message and encrypts it
as follows:
if (original Char+key > 126) then
encrypted Char = 32+ ((original Char + key) - 127) bloode
else
encrypted Char = (original Char + key)
For example, if the enemy uses key = 10 then the message "Hey" would be
encrypted as:
"eld" nuoning
Transcribed Image Text:code for thr ming Project 7 or 8 with no changes. 11. Your country is at war and your enemies are using a secret code to com municate with each other. You have managed to intercept a message that reads as follows: :mmZ\dxZmx] Zpgy The message is obviously encrypted using the enemy's secret code. You have just learned that their encryption method is based upon the ASCII in a string are encoded using this system. For example, the letter "A" is code. Appendix 3 shows the ASCII character set. Individual characters encoded using the number 65 and "B" is encoded using the number 66. Your enemy's secret code takes each letter of the message and encrypts it as follows: if (original Char+key > 126) then encrypted Char = 32+ ((original Char + key) - 127) bloode else encrypted Char = (original Char + key) For example, if the enemy uses key = 10 then the message "Hey" would be encrypted as: "eld" nuoning
Character
H
e
y
ASCII code
72
101
121
Programming Projects
Encrypted H=
(72+ 10)
= 82 = R in ASCII
Encrypted e
(101 + 10) = 111 = o in ASCII
Encrypted y = 32 + ((121 + 10) - 127) = 36 = $ in ASCII
Consequently, "Hey" would be transmitted as "Ro$."
Write a program that decrypts the intercepted message. The ASCII codes
for the unencrypted message are limited to the visible ASCII characters.
You only know that the key used is a number between 1 and 100. Your
program should try to decode the message using all possible keys between
1 and 100. When you try the valid key, the message will make sense. For
all other keys, the message will appear as gibberish.
The time should be
Transcribed Image Text:Character H e y ASCII code 72 101 121 Programming Projects Encrypted H= (72+ 10) = 82 = R in ASCII Encrypted e (101 + 10) = 111 = o in ASCII Encrypted y = 32 + ((121 + 10) - 127) = 36 = $ in ASCII Consequently, "Hey" would be transmitted as "Ro$." Write a program that decrypts the intercepted message. The ASCII codes for the unencrypted message are limited to the visible ASCII characters. You only know that the key used is a number between 1 and 100. Your program should try to decode the message using all possible keys between 1 and 100. When you try the valid key, the message will make sense. For all other keys, the message will appear as gibberish. The time should be
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
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