Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help using JAVA. Show me the output also Thanks in advance! Your country is at war and your enemies are using a secret code

image text in transcribed
image text in transcribed
Please help using JAVA. Show me the output also
Thanks in advance!
Your country is at war and your enemies are using a secret code to communicate with each other. You have managed to intercept a message that read as follows: The message is obviously encrypted using the enemys secret code. You have just learned that their encryption method is based upon the ASCII code. Individual characters in a string are encoded using this system. For example, the letter 'A' is encoded using the number 65 and B' is encoded using the number 66. Your enemys secret code takes each letter of the message and encrypts it as follows (using a secret key): If (OriginalChar Key 126) then EncryptedChar = ((Origina!Char + Key) -127) + 32 Else EncryptedChar = (Origina!Char + Key) For example, if the enemy uses Key = 10 then the message "Hey, would be encrypted as: Character ASCII 72 101 121 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 "RoS". Write a program that decrypts the intercepted message. You only know that the key used is a number between 1 and 100. Your program should

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What functions might this behavior be serving?

Answered: 1 week ago