Question: The Caesar cipher is a type of substitution cipher in which each alphabet in the plaintext or messages is shifted by a number of places down the alphabet. For example, with a shift of 1, P would be replaced by Q, Q would become R, and so on. To pass an encrypted message from one person to another, it is first necessary that both parties have the 'Key' for the cipher, so that the sender may encrypt and the receiver may decrypt it. Key is the number of OFFSET to shift the cipher alphabet. Key can have basic shifts from 1 to 25 positions as there are 26 total alphabets. As we are designing custom Caesar Cipher, in addition to alphabets, we are considering numeric digits from 0 to 9. Digits can also be shifted by key places. For Example, if a given plain text contains any digit with values 5 and keyy =2, then 5 will be replaced by 7, ""(minus sign) will remain as it is. Key value less than O should result into "INVALID INPUT" Example 1: Enter your PlainText: All the best Enter the Key: 1 The encrypted Text is: Bmm uif Cftu Write a function CustomCaesarCipher(int key, String message) which will accept plaintext and key as input parameters and returns its cipher text as output.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
10. Write the Caesar cipher function. Need C, C++, Java, Python, or Perl code for the below question. Important: Do not copy codes from prepinsta.com.
Question: The Caesar cipher is a type of substitution cipher in which each alphabet
in the plaintext or messages is shifted by a number of places down the alphabet.
For example, with a shift of 1, P would be replaced by Q, Q would become R, and so
on.
To pass an encrypted message from one person to another, it is first necessary that
both parties have the 'Key' for the cipher, so that the sender may encrypt and the
receiver may decrypt it.
Key is the number of OFFSET to shift the cipher alphabet. Key can have basic shifts
from 1 to 25 positions as there are 26 total alphabets.
As we are designing custom Caesar Cipher, in addition to alphabets, we are
considering numeric digits from 0 to 9. Digits can also be shifted by key places.
For Example, if a given plain text contains any digit with values 5 and keyy =2,
then 5 will be replaced by 7, "-"(minus sign) will remain as it is. Key value less than
O should result into "INVALID INPUT"
Example 1:
Enter your PlainText: All the best
Enter the Key: 1
The encrypted Text is: Bmm uif Cftu
Write a function CustomCaesarCipher(int key, String message) which will accept
plaintext and key as input parameters and returns its cipher text as output.
C Code:
Transcribed Image Text:Question: The Caesar cipher is a type of substitution cipher in which each alphabet in the plaintext or messages is shifted by a number of places down the alphabet. For example, with a shift of 1, P would be replaced by Q, Q would become R, and so on. To pass an encrypted message from one person to another, it is first necessary that both parties have the 'Key' for the cipher, so that the sender may encrypt and the receiver may decrypt it. Key is the number of OFFSET to shift the cipher alphabet. Key can have basic shifts from 1 to 25 positions as there are 26 total alphabets. As we are designing custom Caesar Cipher, in addition to alphabets, we are considering numeric digits from 0 to 9. Digits can also be shifted by key places. For Example, if a given plain text contains any digit with values 5 and keyy =2, then 5 will be replaced by 7, "-"(minus sign) will remain as it is. Key value less than O should result into "INVALID INPUT" Example 1: Enter your PlainText: All the best Enter the Key: 1 The encrypted Text is: Bmm uif Cftu Write a function CustomCaesarCipher(int key, String message) which will accept plaintext and key as input parameters and returns its cipher text as output. C Code:
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Public key encryption
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education