Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a menu driven program that will (#2 and #3 is make testing easier) It should provide the user with a choice to either encrypt

Create a menu driven program that will (#2 and #3 is make testing easier)

It should provide the user with a choice to either encrypt or decrypt a file; for example:

1 Encrypt

2 Decrypt

3 About

4 Quit

If the user selects to encrypt, a file you should simply always assume the files name is Data.in and the output is Data.out

If the user selects to decrypt, a file should simply always be assumed to be name Data.out and it is to be decrypted to Data.in

It should use a Caesar cipher (see textbook)

It should always prompt the user for a key, so different users can use the algorithm.

You need to submit your .cpp source code make certain that your code uses functions or classes and has short informative comments.

See next page for textbook help.

PART OF THE CODE:

// based on Window's CertUtil.exe command line // search for certutil on // https://docs.microsoft.com // // date: 16 May 2018 // There are C++ objects that do this better. #include  #include  #include  using namespace std; // sample commands const string HELP_ALL = "-? -v"; // specific help - -? const string HELP_HASH = "-hashfile -?"; const string USAGE = "CertUtil [Options] -hashfile InFile [HashAlgorithm]"; // list of current algorithms const int N = 7; const string Hashs[N] ={"MD2", "MD4", "MD5", "SHA1", "SHA256", "SHA384", "SHA512"}; void CertUtil(const string ¶) { string cmd = "certutil "+ para; system( cmd.c_str() ); // send to console. } void getFile(string &fn ){ cout <<"filename and path:"; cin >> fn; } void display(const string alg[], int N) { cout <<" your encryption choices "; for(int i=0; i> h; string algorithm =Hashs[h]; // build command-line string string cmd = "-hashfile "+filename+" "+algorithm; CertUtil(cmd); // go do it.. cout << USAGE << endl; // help with usage cmd = "pause"; // command line system( cmd.c_str() ); // send to console return 0; }

// based on Window's CertUtil.exe command line // search for certutil on // https://docs.microsoft.com // // date: 16 May 2018 // There are C++ objects that do this better. #include  #include  #include  using namespace std; // sample commands const string DECODE = "-decode "; // Decode a Base64-encoded file const string ENCODE = "-encode "; // Encode a Base64-encoded file const string HASHFILE = "-decode "; // Generate and display a cryptographic hash const string HELP_ALL = "-? -v"; // specific help - -? const string HELP_HASH = "-hashfile -?"; const string USAGE = "CertUtil [Options] -hashfile InFile [HashAlgorithm]"; // list of current algorithms const int N = 7; const string Hashs[N] ={"MD2", "MD4", "MD5", "SHA1", "SHA256", "SHA384", "SHA512"}; void CertUtil(const string ¶) { string cmd = "certutil "+ para; system( cmd.c_str() ); // send to console. } void getFile(string &fn ){ cout<<"filename and path:"; cin >> fn; } void display(const string alg[], int N) { cout <<" your encryption choices "; for(int i=0; i 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

how would you have done things differently?

Answered: 1 week ago