Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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)

 

 

 

Sure! Below is the transcription of the text from the image:

---

**EncryptedA.txt**

```
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 aoxdrr'rahni, cd gigvqi cei dkamafpn masif
dfnw cei ifqdgig gpcp. afxvcr cd cei pnmdkaceo cwxaqpnnw afsdnsi
ppgacadfpn riqkic gpcp qpnnig liwr, teaqe xkisifcr cei oirrmi ukdo hiafm
giqdgig-isif au cei pnmdkaceo ar xvhnaqnw lfdtf.
```

**Description:**

- **File Name and Size**: "EncryptedA.txt" is a text file with a size of 407 Bytes.
- **Text Format**: The content appears to be encrypted or encoded text and does not form recognizable words or sentences in English.
  
There are no graphs or diagrams in the image.
expand button
Transcribed Image Text:Sure! Below is the transcription of the text from the image: --- **EncryptedA.txt** ``` 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 aoxdrr'rahni, cd gigvqi cei dkamafpn masif dfnw cei ifqdgig gpcp. afxvcr cd cei pnmdkaceo cwxaqpnnw afsdnsi ppgacadfpn riqkic gpcp qpnnig liwr, teaqe xkisifcr cei oirrmi ukdo hiafm giqdgig-isif au cei pnmdkaceo ar xvhnaqnw lfdtf. ``` **Description:** - **File Name and Size**: "EncryptedA.txt" is a text file with a size of 407 Bytes. - **Text Format**: The content appears to be encrypted or encoded text and does not form recognizable words or sentences in English. There are no graphs or diagrams in the image.
Certainly! Here is the transcription of the text for an educational website:

---

**EncryptedB.txt**

mr e wdqqixvmg irgvdtxmsr epksvmsxlq, fsxl xli wirhiv erh xli vigmtmirx ywi xli weqi oid (orsbr ew xli wigvix oid) xs irgvdtx erh higvdtx xli qiwveki. sri aivd fewmq wdqqixvmg irgvdtxmsr epksvmsxlq mw orsbr ew xli vsxexmsrep gmtliv. mr xlmw epksvmsxlq, xli wirhiv wmqtpd "ehhw" xli oid xs iegl glevegxiv sj xli gpievcixc qiwweki xs jsvq xli gmtlivxcix. 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 gmtlivxcix xs sfemr xli svmkmrep qiwweki.

---

This document seems to be a structured cryptographic passage, potentially exploring encryption techniques. The text is encoded and may require decryption techniques such as letter substitution or Caesar cipher decoding to derive meaningful information. 

If there is a need for a detailed explanation or analysis of specific elements, feel free to inquire!
expand button
Transcribed Image Text:Certainly! Here is the transcription of the text for an educational website: --- **EncryptedB.txt** mr e wdqqixvmg irgvdtxmsr epksvmsxlq, fsxl xli wirhiv erh xli vigmtmirx ywi xli weqi oid (orsbr ew xli wigvix oid) xs irgvdtx erh higvdtx xli qiwveki. sri aivd fewmq wdqqixvmg irgvdtxmsr epksvmsxlq mw orsbr ew xli vsxexmsrep gmtliv. mr xlmw epksvmsxlq, xli wirhiv wmqtpd "ehhw" xli oid xs iegl glevegxiv sj xli gpievcixc qiwweki xs jsvq xli gmtlivxcix. 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 gmtlivxcix xs sfemr xli svmkmrep qiwweki. --- This document seems to be a structured cryptographic passage, potentially exploring encryption techniques. The text is encoded and may require decryption techniques such as letter substitution or Caesar cipher decoding to derive meaningful information. If there is a need for a detailed explanation or analysis of specific elements, feel free to inquire!
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education