Question

In: Computer Science

Assignment 1 – Cipher Situation. You have been employed as a cipher clerk for the Secret...

Assignment 1 – Cipher

Situation.

You have been employed as a cipher clerk for the Secret Service agency. The radio operators have intercepted a foreign transmission, which is heavily encrypted. They are currently attempting to decrypt this information and have requested your help. The contents of the encrypted message are as follows:

Y [ZU [ XZWZ \ XXZjZ [ [ WWVWU

Ogaqkxpgbqbfiof! Cyw'ss bun!

Zqksxl cywd lnepwvs uozneh.

Qjc mgabiy nfx vmz-djrhkfalfq.

Xnjfx ai qjvi viqi uat pgw odjwp.

The radio operators have some information that they share with you, in their attempt to decrypt the message. The information is as follows:

‐ The first character of the entire message decrypts to the number ‘5’.

‐ It is known that the first line of the message forms some sort of combined encryption key that is required to decrypt the rest of the message.

‐ Except for the first line, special characters and spaces are not encrypted in the message. They can be skipped.

‐ XOR encryption was not done on the entire message but all other forms of numerical conversion and encryption are possibly used within the message.

‐ The use of upper‐case and lower‐case characters in the message are important for decryption.

Requirements:

You are required to programmatically implement an automatic decryption tool, using only C++ as your programming language. Your program must show how all steps of the decryption process are resolved, for any marks to be awarded. This is similar to the decryption method being done manually, by hand on paper, showing all steps and working as to how the final answer is obtained. The encrypted message must be stored as an input text file named “encrypted.txt” (without the quotation marks).   Your implementation must contain:

‐ The entire operation of the program must use classes and its respective methods (class functions). Functions that are not implemented as class methods, except for the main function, will be disregarded for marking.

‐ The input text file must be read as an input argument to the program, from the system command prompt in the following format: program_name -input encrypyted.txt

‐ Your program must not crash due to incorrect inputs.

‐ Each step of the decryption process must be outputted to the system command prompt.

‐ Any numerical conversions must be done directly e.g. binary to octal, without the use of decimal. The use of intermediary bases will be disregarded for marking.

‐ An input argument named “‐silent” (without the quotation marks), is required to be implemented. This is to allow for a driver function to be called and only for the final answer to be outputted to the system command prompt. The format for this argument, coupled with the text file argument, can be seen below: program_name -input encrypted.txt -silent.

This should be coded using C++ programming language.

Solutions

Expert Solution

Encrypting and Decryption

There is a simple method of adding and subtracting the key values for encryption and decryption.

For encrypting a string key-value 5 is added to the ASCII values of the characters in the string. Similarily

for decrypting a string key-value 5 is subtracted to the ASCII value of the characters.

program

// Simple C++ program to encrypt and decrypt a string

#include<iostream.h>

#include<conio.h>

// using namespace std;

void main()

{

int i,x;

char str[100];

cout<<"Please enter a string :\t";

cin>>x;

// using switch case statements

switch(x)

{

// First case for encrypting a string

case 1:

for(i=0;(i<100 && str[i] ! = '\0');i++)

str[i] = str[i]-5;

\\ the key for encryption is 5 that is added to ASCII value

cout<<" \n Encrypted string : "<<str<<endl;

break;

// Second case for decrypting a string

case 2:

for(i=0;(i<100 && str[i] ! = '\0';i++)

str[i] = str[i]-2;

\\ the key for decryption is 5 that is subtracted from ASCII value

cout<<"\n Decrypted string : "<<str<<endl;

break;

default:

cout<<" \n Invalid Input \n";

}

getch();

}


Related Solutions

Situation (Data Structures and Sorting C++) You have been employed at BmoCel, an internet service provider....
Situation (Data Structures and Sorting C++) You have been employed at BmoCel, an internet service provider. Data is sent as packets from their server to their clients. Each packet has a fixed size of 16 alphanumeric characters. However, they are currently having problems with managing their data transmissions. Your bosses have asked you to rectify the problems, in the following order: 1. The data at the server is to be stored as packets, in a First‐In, Last‐Out manner. If there...
(b) You have been employed as a network administrator in an organization. If you have to...
(b) You have been employed as a network administrator in an organization. If you have to send the data of your organization through the internet (there might be very untrusty network nodes), what kind of encryption will you use? Further, sometimes attackers exploit a special feature of the transport layer (segmentation and reassembly) to launch an attack. What attack is this? (c) Of the various firewall types available for use in a business network, which type collects network connection information...
1. Assuming that you have been employed by the government of Ghana to develop a 10-year...
1. Assuming that you have been employed by the government of Ghana to develop a 10-year development plan for Ghana. (a) Describe the steps you would follow to design the plan by using any one of the following planning models i. Rational planning ii. Transactive planning iii. Bargaining planning (b) Discuss the potential benefits and challenges associated with the use of your chosen planning model to perform the task above.
1. You have just been employed by a firm that is operating under a “perfectly competitive”...
1. You have just been employed by a firm that is operating under a “perfectly competitive” environment and also with the following relevant market information: -- Current market price per unit is $15 (NOTE: this is also the firm’s marginal revenue, MR) TC = 0.5Q2 MC = Q a) Using profit maximizing quantity level at 15, what is the firm’s TR? b ) What is the firm’s TC using the same profit maximizing quantity level as a above? c. What...
You have recently been employed by a company that wants to “go global” and you have...
You have recently been employed by a company that wants to “go global” and you have been selected to help research this possibility. The CEO has instructed you to research the country of France and report back. You must prepare a report on your country’s religion, government, and technology structures.
The assignment will be in our current situation you are able to have fans in your...
The assignment will be in our current situation you are able to have fans in your arena/stadium at a 25% capacity. How with the current guidelines and social distancing do you pull this off. Questions: What is you plan for social distancing fans in the stands? Where would you place hand sanitizer? How will your parking lots look like? How will you scan tickets? How will concessions look like? How will you serve food/drinks? What will Leaving the Stadium Look...
The assignment will be in our current situation you are able to have fans in your...
The assignment will be in our current situation you are able to have fans in your arena/stadium at a 25% capacity. How with the current guidelines and social distancing do you pull this off. Questions: What is you plan for social distancing fans in the stands? Where would you place hand sanitizer? How will your parking lots look like? How will you scan tickets? How will concessions look like? How will you serve food/drinks? What will Leaving the Stadium Look...
You have been employed as a cost accountant since a few years. You suspect that the...
You have been employed as a cost accountant since a few years. You suspect that the commercial manager is over-billing customers
You are a recent accounting graduate and have been employed in the Financial Reporting Unit of...
You are a recent accounting graduate and have been employed in the Financial Reporting Unit of Myer Holdings Ltd, an ASX listed firm. Preparations are underway for the completion of the general purpose financial report for the year ended 29 July 2018 and you have been asked by the Chief Financial Officer to identify any major accounting issues which will need to be considered. Your attention is drawn to a media release by ASIC on 31 May 2018 (ASIC Media...
You have been employed by the local circus to plan their human cannonball performance. For this...
You have been employed by the local circus to plan their human cannonball performance. For this act, a spring-loaded cannon will shoot a human projectile, the Great Flyinski, across the big top to a net below. The net is located 4 m lower than the muzzle of the cannon from which the Great Flyinski is launched. The cannon will shoot the Great Flyinski at an angle of 45 degrees above the horizontal and at a speed of 15 m/s. The...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT