etter of the message is shifted a fixed dista comes D. B becomes E, and so on. For the e and "wrap around". W becomes Z, X bece change a message back, each letter is repla MNOPO RST U V WX

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question
Experiment 1: IMPLEMENTATION OF CAESAR CIPHER
Objective:
To implement the simple substitution technique named Caesar cipher using C+ language.
Theory:
To enerypt a message with a Caesar cipher, each letter in the message is changed using a
simple rule: shift by three. Each letter of the message is shifted a fixed distance (3 for
example) down the alphabet, A becomes D, B becomes E, and so on. For the last letters,
we can think of alphabet as a circle and "wrap around", W becomes Z. X becomes A, Y
becomes B, and Z becomes C. To change a message back, cach letter is replaced by the
one three before it.
Example
ABCDEFGHIJKLMNOPQRSTUVWXYZ
t t t t t t t t ttt t t t t t t tt t t t t t t ft
DEFGHIJKLMNOPQRSTUVW XY Z ABc)
digorithm
STEP-1: Read the plain text from the user.
STEP-2: Read the key value from the user.
STEP-3: If the key is positive then encrypt the text by adding the key with each character
in the plain text.
STEP-4: Else subtract the key from the plain text.
STEP-5: Display the cipher text obtained above
Procedure
Write a C++ code to implement Caesar cipher.
Transcribed Image Text:Experiment 1: IMPLEMENTATION OF CAESAR CIPHER Objective: To implement the simple substitution technique named Caesar cipher using C+ language. Theory: To enerypt a message with a Caesar cipher, each letter in the message is changed using a simple rule: shift by three. Each letter of the message is shifted a fixed distance (3 for example) down the alphabet, A becomes D, B becomes E, and so on. For the last letters, we can think of alphabet as a circle and "wrap around", W becomes Z. X becomes A, Y becomes B, and Z becomes C. To change a message back, cach letter is replaced by the one three before it. Example ABCDEFGHIJKLMNOPQRSTUVWXYZ t t t t t t t t ttt t t t t t t tt t t t t t t ft DEFGHIJKLMNOPQRSTUVW XY Z ABc) digorithm STEP-1: Read the plain text from the user. STEP-2: Read the key value from the user. STEP-3: If the key is positive then encrypt the text by adding the key with each character in the plain text. STEP-4: Else subtract the key from the plain text. STEP-5: Display the cipher text obtained above Procedure Write a C++ code to implement Caesar cipher.
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Encryption and decryption
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr