This lab must be done in C++ Assignment: In cryptography, encryption is the process of encoding a message or information in such a way that only authorized parties can access it. In this lab you will write a program to decode a message that has been encrypted.  Detailed specifications: Define three classes. Each one should be in a separate file. You can choose to define the class and its functions inline, all in a header file, or have a .h and .cpp file for each class. Abstract base class with the following: A variable to hold an encrypted message. This variable should be a string which is initialized in the constructor. A status variable that will tell whether the message was loaded successfully. A constructor that receives one parameter: a string variable with a file name and uploads its content to the string variable that is supposed to store it. A pure virtual function called decode. This function will be defined in derived classes. A function that prints the message on the screen A derived class that implements a version of decode according to the following algorithm: input character: abcdefghijklmnopqrstuvwxyz decoded character:  iztohndbeqrkglmacsvwfuypjx That means each 'a' in the input text should be replaced with an 'i', each 'b' with a 'z' and so forth. A second derived class that implements a version of decode according algorithm known as "rotational cypher". In this encryption method, a key is added to each letter of the original text. For example: Cleartext:        A    P    P    L    E           Key:       4    4    4    4    4 Ciphertext:      E    T    T    P    I In order to decode, you need to subtract 4. I will provide a program that tests your classes.  Testing/Output: Please use the following files as input text files: EncryptedA.txt and EncryptedB.txt Input Files Content to easily copy: EncryptedA.txt (Content is paragraph right below): ifqkwxcadf ar cei fpoi masif cd cei xkdqirr du pxxnwafm pf pnmdkaceo cd p oirrpmi, teaqe rqkpohnir cei gpcp af ac-oplafm ac sikw gauuaqvnc pfg caoi qdfrvoafm, au fdc xkpqcaqpnnw aoxdrrahni, cd gigvqi cei dkamafpn masif dfnw cei ifqdgig gpcp. afxvcr cd cei pnmdkaceo cwxaqpnnw afsdnsi pggacadfpn riqkic gpcp qpnnig liwr, teaqe xkisifcr cei oirrpmi ukdo hiafm giqdgig-isif au cei pnmdkaceo ar xvhnaqnw lfdtf. EncryptedB.txt (Content is paragraph right below): mr e wdqqixvmg irgvdtxmsr epksvmxlq, fsxl xli wirhiv erh xli vigmtmirx ywi xli weqi oid (orsbr ew xli wigvix oid) xs irgvdtx erh higvdtx xli qiwweki. sri aivd fewmg wdqqixvmg irgvdtxmsr epksvmxlq mw orsbr ew xli vsxexmsrep gmtliv. mr xlmw epksvmxlq, xli wirhiv wmqtpd "ehhw" xli oid xs iegl glevegxiv sj xli gpievxicx qiwweki xs jsvq xli gmtlivxicx. jsv iceqtpi, mj xli oid mw 2, "e" bsyph figsqi "g", "f" bsyph figsqi "h", erh ws sr. xli vigmtmirx bsyph xlir higvdtx xli qiwweki fd "wyfxvegxmrk" xli oid jvsq iegl glevegxiv sj xli gmtlivxicx xs sfxemr xli svmkmrep qiwweki.   The output should be printed on the screen. Attach the output of your program as a comment at the end of your source code.  Turn in: Encrypted.h, CypherA.h and CypherB.h (corresponding .cpp files optional)

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
100%

This lab must be done in C++

Assignment:

In cryptography, encryption is the process of encoding a message or information in such a way that only authorized parties can access it. In this lab you will write a program to decode a message that has been encrypted. 

Detailed specifications:

Define three classes. Each one should be in a separate file. You can choose to define the class and its functions inline, all in a header file, or have a .h and .cpp file for each class.

  • Abstract base class with the following:
    • A variable to hold an encrypted message. This variable should be a string which is initialized in the constructor.
    • A status variable that will tell whether the message was loaded successfully.
    • A constructor that receives one parameter: a string variable with a file name and uploads its content to the string variable that is supposed to store it.
    • pure virtual function called decode. This function will be defined in derived classes.
    • A function that prints the message on the screen
  • A derived class that implements a version of decode according to the following algorithm:
    • input character: abcdefghijklmnopqrstuvwxyz
    • decoded character:  iztohndbeqrkglmacsvwfuypjx
    • That means each 'a' in the input text should be replaced with an 'i', each 'b' with a 'z' and so forth.
  • A second derived class that implements a version of decode according

    algorithm known as "rotational cypher". In this encryption method, a key is added to each letter of the original text. For example:

    Cleartext:        A    P    P    L    E
  •           Key:       4    4    4    4    4
  • Ciphertext:      E    T    T    P    I

    In order to decode, you need to subtract 4.

I will provide a program that tests your classes. 

Testing/Output:

Please use the following files as input text files: EncryptedA.txt and EncryptedB.txt

Input Files Content to easily copy:

EncryptedA.txt (Content is paragraph right below):

ifqkwxcadf ar cei fpoi masif cd cei xkdqirr du pxxnwafm pf pnmdkaceo cd p oirrpmi, teaqe rqkpohnir cei gpcp af ac-oplafm ac sikw gauuaqvnc pfg caoi qdfrvoafm, au fdc xkpqcaqpnnw aoxdrrahni, cd gigvqi cei dkamafpn masif dfnw cei ifqdgig gpcp. afxvcr cd cei pnmdkaceo cwxaqpnnw afsdnsi pggacadfpn riqkic gpcp qpnnig liwr, teaqe xkisifcr cei oirrpmi ukdo hiafm giqdgig-isif au cei pnmdkaceo ar xvhnaqnw lfdtf.

EncryptedB.txt (Content is paragraph right below):

mr e wdqqixvmg irgvdtxmsr epksvmxlq, fsxl xli wirhiv erh xli vigmtmirx ywi xli weqi oid (orsbr ew xli wigvix oid) xs irgvdtx erh higvdtx xli qiwweki. sri aivd fewmg wdqqixvmg irgvdtxmsr epksvmxlq mw orsbr ew xli vsxexmsrep gmtliv. mr xlmw epksvmxlq, xli wirhiv wmqtpd "ehhw" xli oid xs iegl glevegxiv sj xli gpievxicx qiwweki xs jsvq xli gmtlivxicx. jsv iceqtpi, mj xli oid mw 2, "e" bsyph figsqi "g", "f" bsyph figsqi "h", erh ws sr. xli vigmtmirx bsyph xlir higvdtx xli qiwweki fd "wyfxvegxmrk" xli oid jvsq iegl glevegxiv sj xli gmtlivxicx xs sfxemr xli svmkmrep qiwweki.

 

The output should be printed on the screen. Attach the output of your program as a comment at the end of your source code. 

Turn in:

Encrypted.h, CypherA.h and CypherB.h (corresponding .cpp files optional)

 

 

 

EncryptedA.txt
Download EncryptedA.txt (407 Bytes)
ZOOM
ifqkwxcadf ar cei fpoi masif cd cei xkdqirr du pxxnwafm pf pnmdkaceo cd p
oirrpmi, teaqe rqkpohnir cei gpcp af ac-oplafm ac sikw gauuaqvnc pfg caoi
qdfrvoafm, au fdc xkpqcaqpnnw aoxdrrahni, cd gigvqi cei dkamafpn masif
dfnw cei ifqdgig gpcp. afxvcr cd cei pnmdkaceo cwxaqpnnw afsdnsi
pggacadfpn riqkic gpcp qpnnig liwr, teaqe xkisifcr cei oirrpmi ukdo hiafm
giqdgig-isif au cei pnmdkaceo ar xvhnaqnw lfdtf.
Transcribed Image Text:EncryptedA.txt Download EncryptedA.txt (407 Bytes) ZOOM ifqkwxcadf ar cei fpoi masif cd cei xkdqirr du pxxnwafm pf pnmdkaceo cd p oirrpmi, teaqe rqkpohnir cei gpcp af ac-oplafm ac sikw gauuaqvnc pfg caoi qdfrvoafm, au fdc xkpqcaqpnnw aoxdrrahni, cd gigvqi cei dkamafpn masif dfnw cei ifqdgig gpcp. afxvcr cd cei pnmdkaceo cwxaqpnnw afsdnsi pggacadfpn riqkic gpcp qpnnig liwr, teaqe xkisifcr cei oirrpmi ukdo hiafm giqdgig-isif au cei pnmdkaceo ar xvhnaqnw lfdtf.
EncryptedB.txt
Download EncryptedB.txt (577 Bytes)
mr e wdqqixvmg irgvdtxmsr epksvmxlq, fsxl xli wirhiv erh xli vigmtmirx ywi
xli weqi oid (orsbr ew xli wigvix oid) xs irgvdtx erh higvdtx xli qiwweki.
sri aivd fewmg wdqqixvmg irgvdtxmsr epksvmxlq mw orsbr ew xli vsxexmsrep
gmtliv. mr xlmw epksvmxlq, xli wirhiv wmqtpd "ehhw" xli oid xs iegl
glevegxiv sj xli gpievxicx qiwweki xs jsvq xli gmtlivxicx. jsv iceqtpi, mj
xli oid mw 2, "e" bsyph figsqi "g", "f" bsyph figsqi "h", erh ws sr. xli
vigmtmirx bsyph xlir higvdtx xli qiwweki fd "wyfxvegxmrk" xli oid jvsq
iegl glevegxiv sj xli gmtlivxicx xs sfxemr xli svmkmrep qiwweki.
Transcribed Image Text:EncryptedB.txt Download EncryptedB.txt (577 Bytes) mr e wdqqixvmg irgvdtxmsr epksvmxlq, fsxl xli wirhiv erh xli vigmtmirx ywi xli weqi oid (orsbr ew xli wigvix oid) xs irgvdtx erh higvdtx xli qiwweki. sri aivd fewmg wdqqixvmg irgvdtxmsr epksvmxlq mw orsbr ew xli vsxexmsrep gmtliv. mr xlmw epksvmxlq, xli wirhiv wmqtpd "ehhw" xli oid xs iegl glevegxiv sj xli gpievxicx qiwweki xs jsvq xli gmtlivxicx. jsv iceqtpi, mj xli oid mw 2, "e" bsyph figsqi "g", "f" bsyph figsqi "h", erh ws sr. xli vigmtmirx bsyph xlir higvdtx xli qiwweki fd "wyfxvegxmrk" xli oid jvsq iegl glevegxiv sj xli gmtlivxicx xs sfxemr xli svmkmrep qiwweki.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Data members
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
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