a C++ program that implements a few common operations that involve a simple cipher engine – primarily addition, keys_transfer, assignment and printing to the standard output.

Cerrado

Following up the partA and partB of this project, the code of project 1

need to implement operator overload and error handling. The header file has been slight modified

accordingly. The memory of private data string need to be dynamic allocated.

In part B, LCR has been introduced to encrypt the data string. In order to decrypt the data string,

modulus inverse method is often used. (refer to

[url removed, login to view] ). A simple method such as

extensive search can easily solve the inversion. For example: if when the encryption ‘f’ is

ciphered to ‘c’. During decryption, the code can simply scan from ‘a’ all the way to ‘space’ and

check which one can be encrypted to ‘c’ by using the same keys values.

The header file has been provide as below:

// File name: LCR_Ciper.h

// Description: Header file for LCR

// Date: 2/14/2017

//

#include <iostream>

#include <iomanip>

#include <stdlib.h>

#include <fstream>

using namespace std;

class LCR_cipher

{

Spring 2017

2

// overload operator<< to print context to console

friend ostream& operator<<(ostream& out, LCR_cipher& m);

public:

// Constructor: allocate memory to save context and keys

LCR_cipher(char *context_string, char *keys_string);

// Copy constructor:

LCR_cipher(const LCR_cipher& other);

// Destructor: deallocate memory that was allocated dynamically

~LCR_cipher();

//check whether *keys string has valid LCR encryption value

bool iskeysOK();

//check whether the context string is encrypted or not

bool isencrypted();

//Retrieve CLR encryption value from *keys string

void getkeys(int& a, int& c);

// output the *context to console

void output_context();

//using operator ++ to encrypt context string

LCR_cipher& operator++();

//using operator -- to unencrypt context string

LCR_cipher& operator--();

//Assignment operator overload

LCR_cipher& operator=(const LCR_cipher& other);

…… all the other operators…..

private:

char *context; //array to store context string

char *keys; //array to store encryption keys

bool encrypted; //whether string in *context is encrypted or not

}; // End class

// End header file

For this project, you should overload the following night operators:

Overloaded

function

Action

++ Using keys to encrypt the context

-- Using keys to decrypt the context

= For A=B, instance A will have same context and keys as instance B

< For A<B, instance A will get keys from instance B

+ If two instances have same keys values, the context of A and B can be concatenate

sequentially

+=

If two instances have same keys values, concatenate the context of A and B and assign

to a third instance

== Test if the unencrypted context of A and B are same or not

!= Test if the unencrypted context of A and B are different or not

<< Output the context to console

Exception handling: Your implementation should use try, throw, and catch to handle

exceptions. (See C++ Interlude 3 in the textbook.) At a minimum, your code should take care of

the following three cases:

1. Trying to create LCR_cipher object without valid context and keys, such as empty string.

2. If new returns NULL when allocating memory for data.

3. If the program attempts to add two instance with different keys.

File naming conventions: The name of your header (“specification”) file must be exactly

LCR_cipher.h, and the name of your source (“implementation”) file must be exactly

LCR_cipher.cpp. This latter file must contain your implementation of the ADT. Separate

client files will be posted in Canvas, for use in testing your code. These client files will have

names similar to [url removed, login to view], [url removed, login to view], etc., and each of these will contain a main()

function.

Habilidades: Programación en C++

Ver más: how to write a good written assignment for standard level english a, academic standard assignment, assignment matrix addition, java file input output assignment, assignment standard costing excel, assignment university standard, standard browser keys, printing perl output columns xls, wellsite information transfer standard update, standard shortcut keys web apps, standard report output excel oracle 11i, standard website printing company, comsol output matlab transfer, printing prepress standard operating procedure manual, perl printing script output file

ID de proyecto: #13133371

Adjudicado a:

wangbeizou

Hello. How are you. I have read and understood the project. I'm an Expert in Data Structures and Algorithms. And I know well ; Java ,C/C++, Python ,PHP. I'm interested this project. So, firstly I want to discu Más

$90 USD en 2 días
(37 comentarios)
4.9

7 los freelancers están ofertando un promedio de $152 para este trabajo.

LiangXiaoJin

Dear client, how are you? I am a C/C++ programmer and mathematician. Please check my "Profile & Work List" and contact with me if my skill is in your concern. Looking forward to your response. Thanks.

$300 USD en 3 días
(31 comentarios)
6.4
yamaf555

Oh,friendly dear!!! I have the expensive experience of 5 years in developingC++ programming,Cryptopology and can carry out your any proposal in time completely. I understand your proposal enough,so I have mind to p Más

$155 USD en 3 días
(40 comentarios)
5.2
BeautiCG

Hi,dear. Thank you for your interest. I have just checked your project report,I am able to perform this task with my developer team.I look forward to your proposal...

$155 USD en 1 día
(9 comentarios)
3.6
lingung525

Hi, I am a C++ programmer. I have much experience cipher engine – primarily addition, keys_transfer, assignment and printing to the standard output. I can do this project perfectly. Thanks.

$100 USD en 3 días
(3 comentarios)
2.9
jpStar

Dear sir I have just read your description I have following technologies and skills : - Unity3D and Creating a Game o AR(Augmented Reality) System o 3D, 2D GAME o PC, Android, iPhone Built Más

$155 USD en 3 días
(2 comentarios)
2.0
jigneshlakhani0

I, Jignesh Lakhani have completed My.Tech from IIT Roorkee. I am having very good knowledge of C, C++, Java and data structure. hope we will discuss more on it. thanks, Jignesh

$111 USD en 2 días
(2 comentarios)
1.9
vrickson

Dear Sir, SCOPE : C++ Programming Well understood , I can do it , let us discuss more. Technologies we work @vrickson : (a )Websites / Web Portals / Software ( PHP/WP/Pearl/ASP.Net/C/C++/C# / GoAlan Más

$277 USD en 3 días
(0 comentarios)
0.0
mzdesmag

Dear client i can provide complete solution on your project as i have executed it before. My commitment lies in honesty, integrity, ethical code of conduct, efficiency and speedy respond, i love to work hard to meet Más

$30 USD en 1 día
(0 comentarios)
0.0
$222 USD en 3 días
(0 comentarios)
0.0