(Homework Solution): Can someone assist me on this? Encryption is widely used on the internet to protect user information being sent b

Can someone assist me on this?

Encryption is widely used on the internet to protect user information being sent between a browser and a server, including passwords, payment information and other personal information that should be considered private. An encryption algorithm is applied to the plain text to generate cipher text that can’t be recognized easily. Decryption is simply the inverse of encryption.

We will practice the idea of encryption and decryption in this assignment based on string manipulation. Given a string plaintext, it is encrypted as following:

plaintext is first shifted right length()/2 positions (toward higher index).

Next each letter is changed:

If an uppercase letter: ‘A’->’Z’, ‘B’->’Y’, … ‘M’->’N’, ‘N’->’M’, …, ‘Y’->’B’, ‘Z’->’A’

If a lowercase letter: same idea as for uppercase letter. i.e. ‘a’ -> ‘z’, ‘b’->’y’, …, ‘y’->’b’, ‘z’->’a’

If a digit: same idea as for uppercase letter. i.e. ‘0’ ->’9′, ‘1’->’8′, ‘2’->’7′ …

Anything else remains the same.

For example, given a plain text of “Secret 12”, it’s changed into:

// index: 0 1 2 3 4 5 6 7 8

//        S e c r e t ˽ 1 2

// length is 9, so shift 4 times toward right (9/2 is 4, int division. If length is 10, should shift 5 times)

// After shifting:

t ˽ 1 2 S e c r e

// next change each character:

g ˽ 8 7 H v x i v

Your program should include at least the following:

One function to encrypt a given plain text string as explained above. It should return a string containing the corresponding cipher text.

One function to decrypt a cipher text that has been encrypted as explained above. This function should return the decrypted text as a string.

You may add additional function(s) which is(are) necessary for your design.

Include in your main() one or more testing cases, with each testing case tests both the encryption function and the decryption function as shown below:

std::string str = “Secret 12”;

std::string secretStr = encrypt(str);

std::cout << “original: ” << str << ‘n’;

std::cout << “encrypted: ” << secretStr << ‘n’;

std::cout << “decrypted: ” << decrypt(secretStr) << ‘n’;

Your .cpp file should also contain:

Algorithms (pseudo code) for your encryption function as block comments at the beginning of your source code file. If you choose to draw flowchart, include it in your HW document instead.

/*IN*/, /*OUT*/, /*INOUT*/ comments to each function parameter.

Pre- and Post- condition comments for each function.

Provide at least three testing cases (sample input and expected output for each testing case) and explain why you pick those three. Provide screenshots of the execution matching your three testing cases.

Comment your program appropriately. Pay attention to the standard stuff like coding style, indention, heading, and curly braces.

Submission: 2 files

In one word/pdf document:

Three testing cases and rationale

Screenshot(s) of execution

One .cpp file: name it HW6_YourLastName.cpp

Use the rubric below to check the completeness of your work before turning it in.

Rubric: CS225, HW6

Item Max




Project (35 pts)
Algorithm for encryption function, which matches your code 2
an encryption function 2
Encryption: shift the plain text correctly 5
Encryption: transform each character of the shifted string 5
Encryption: encryption result returned 1
a decryption function 2
Decryption: shift the cipher text correctly 5
Decryption: transform each character of the shifted string 5
Decryption: decryption result returned 1
Function prologue comment

Pre- and Post- condition comments

function parameter type comment on each parameter

Three testing cases and rationale. 3
Your project compiles and runs 1
Programming style (5 pts)

File Prologue comments

Consistent indentation: preferred 2 spaces for each level

Meaningful names for constants and variables; Proper comments in the program




using namespace std; (- 4)
Global variable(s) (- 4)
Missing required screenshot(s) (- 4)
Total: 40

Expert Answer

Order NOW for a 10% Discount
Pages (550 words)
Approximate price: -

Why Us?

Top Quality and Well-Researched Papers

All ourbpapers are written from scratch. In fact, Clients who ask for paraphrasing services are highly discouraged. We have writers ready to craft any paper from scratch and deliver quality ahead of time.

Professional and Experienced Academic Writers

Our writers keeps you posted on your papers progress - providing you with paper outline/draft. You are also at liberty to communicate directly with your writer.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time, in many cases quite ahead of time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.


Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.


Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.


Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.


Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.

× Contact Live Agents