[SOLVED] CECS326 Homework 24   

30.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

Chapter 14 (Page 11 through 18)

Purpose: This assignment provides experience with encryption.

  • Get a copy of the instructors c program.

Compile it and run it. Make sure you can explain what the program prints. (Don’t turn anything in for this part.)

  • Redo homework 2 (c) (yet again).
  1. As you make the copy, encrypt (or decrypt) each block before you write it. The key may be embedded inthe code (like my example).
  2. Add a fourth commandline parameter to your c. If the argv[3][0] is ’e’ encrypt while doing the copy. Otherwise decrypt.

Hint: place an if statement before you start the copy, set a variable to either DES_ENCRYPT or DES_DECRYPT. Use the variable in your copy.

Example:

a.out encrypt.c crypted_file e Produces an encrypted version of encrypt.c

a.out crypted_file encrypted_copy.txt d

Produces an encrypted version of crypted_file (which should be identical to the original file).

File: encrypt.c is a copy of what I used in lecture. It should compile and run.

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.