Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

This is to be written in C++. Thank you so much for you help as I'm really struggling with this. The explosive growth of Internet

This is to be written in C++. Thank you so much for you help as I'm really struggling with this.

The explosive growth of Internet communications and data storage on Internet-connected computers has greatly increased privacy concerns. The field of cryptography is concerned with coding data to make it difficult (and hopefullywith the most advanced schemesimpossible) for unauthorized users to read. In this exercise, youll investigate a simple scheme for encrypting and decrypting data. A company that wants to send data over the Internet has asked you to write a program that will encrypt it so that it may be transmitted more securely. All the data is transmitted as four-digit integers. Your application should read a four-digit integer entered by the user and encrypt it as follows: Replace each digit with the result of adding 7 to the digit and getting the remainder after dividing the new value by 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then print the encrypted integer. Write a separate application that inputs an encrypted four-digit integer and decrypts it (by reversing the encryption scheme) to form the original number.

Requirements:

- This assignment will essentially be two programs. You will write one program and submit it for encryption and one for the decryption and submit it. The requirements are generally the same. But, they are separate programs. I have provided requirements to make this easier than it might seem just reading the description.

- Define 4 integer variables, one for each of the numbers you are to encrypt.

- Prompt the user for each of the integers, with a new line after each prompt an example is like this:

Enter integer 1:(newline)

--read in value--

Enter integer 2:(newline)

--read in value--

Enter integer 3:(newline)

--read in value--

Enter integer 4:(newline)

--read in value--

As you saw in the example above, after each prompt, you will then read in the integer from the user.

For the encryption program, you will follow the encryption instructions from the description:

- Add 7 to the integer

- Get the remainder after dividing by 10

- When finished with the mathematical changes swap the first and last digit

For the decryption program, you will reverse the process:

- Swap the last and first

- Reverse the remainder

- Subtract 7

Finally, display the result:

- For Encryption: "The encrypted value is: --encrypted number--"(newline)

- For Decryption: "The decrypted value is: --decrypted number--"(newline)

Remember there are two programs: one for decrypt and one for encrypt.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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