main.c - { uInput = getKey(F1, key, uInput) } if (uInput ==...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 /********************************************************************************** *** * Name:Arria P. Owlia * EID:apo223 * Section:15735 * Assgmnt:5 * Purpose:To become familiar with file manipulation and pointers using cryptography * Date:04/03/2008 *********************************************************************************** ***/ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <time.h> #include "decipher.h" int main(void) { clock_t start, T1, T2, end double runTime char uInput, F1[MAXFILENMLEN], F2[MAXFILENMLEN], F3[MAXFILENMLEN], key[ALPHALEN + 1], file[MAXFILELEN+1] start = clock() while (1) { printf("Please choose from the following options:\n1. Decrypt\n2. Encrypt\n3. Exit\nEnter your Choice (1, 2, or 3): ") scanf(" %c", &uInput) uInput = uInput - '0' if (uInput == 1 || uInput == 2)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { uInput = getKey(F1, key, uInput) } if (uInput == 1 || uInput == 2) { uInput = makeArray(F2, file, uInput) } if (uInput == 1 || uInput == 2) { makeOutputFile(F3, uInput) } switch (uInput) { case 1: { T1 = clock() decrypt(key, file, F3) T2 = clock() runTime = (T2 - T1) / ((double)CLOCKS_PER_SEC) printf(&quot;\nDecrypt time (sec): %g\n\n&quot;, runTime) break } case 2: { T1 = clock() Page 1 Sheet1 encrypt(key, file, F3) T2 = clock() runTime = (T2 - T1) / ((double)CLOCKS_PER_SEC) printf(&quot;\nEncrypt time (sec): %g\n\n&quot;, runTime) break } case 3: { end = clock() runTime = (end - start) / ((double)CLOCKS_PER_SEC) printf(&quot;Total run time (sec): %g&quot;, runTime) getchar() getchar() return(0) } default: { printf(&quot;Illegal input. Please Try again.\n\n&quot;) fflush(stdin) } } clearAll(F1, F2, F3, key, file) } return(0) } Page 2...
View Full Document

This note was uploaded on 05/01/2008 for the course EE 312 taught by Professor Shafer during the Spring '08 term at University of Texas at Austin.

Page1 / 3

main.c - { uInput = getKey(F1, key, uInput) } if (uInput ==...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online