Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ The Caesar cipher is one of the earliest known and simplest ciphers . It is a type of substitution cipher in which each letter

C++

The Caesar cipher is one of the earliest known and simplest ciphers. It is a type of substitution cipher in which each letter in the plaintext is 'shifted' a certain number of places down the alphabet.

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

U

V

W

X

Y

Z

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

H

E

L

L

O

W

O

R

L

D

Normal Text

B

Y

F

F

I

Q

I

R

M

X

Encrypted Text

You are tasked to create an encryption program which takes a key word. The keyword will fill the first part of the shifted array. The remaining letters will fill the end of the array. It should look like this:

Key=TOY

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

T

O

Y

A

B

C

D

E

F

G

H

I

J

K

L

M

N

P

Q

R

S

U

V

W

X

Z

You should have an interactive menu with the following options:

1 Enter Key word //takes new key word and re-aligns shifted array

2 Encrypt message//takes a message of 140 characters and encrypts message

3 Decrypt message//takes an encrypted massage of 140 characters and decrypts it

4 Quit//exits program;

A couple tips:

Use the copy function from the library not the library. If you use the algorithm library you need to make a change in visual studios precompiler settings or you will get an error. You cannot assign arrays using the = operator; only individual indices of the array can be assigned this way.

Take one case or the other for input. All Caps or all lowercase. You can use toupper() to set all letters to upper case: http://cpp.sh/7gwx

/* toupper example */

#include

#include

#include //for toupper

using namespace std;

int main ()

{

int i=0;

char str[]="Test String. ";

char c;

while (str[i])

{

c=str[i];

str[i]=toupper(c);

i++;

}

std::cout<

return EXIT_SUCCESS;

}

When encrypting/decrypting, dont change characters that are not in your Array set like punctuation and spaces

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

Recommended Textbook for

Semantics Of A Networked World Semantics For Grid Databases First International Ifip Conference Icsnw 2004 Paris France June 2004 Revised Selected Papers Lncs 3226

Authors: Mokrane Bouzeghoub ,Carole Goble ,Vipul Kashyap ,Stefano Spaccapietra

2004 Edition

3540236090, 978-3540236092

More Books

Students also viewed these Databases questions

Question

Graph the following on the number line: 1. 1 2. 4 3. 3

Answered: 1 week ago