Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 6 Ciphers For this assignment we will be implementing 2 different cipher algorithms, a caesar cipher and a Vigenere cipher. Caesar cipher takes a

Assignment 6 Ciphers

For this assignment we will be implementing 2 different cipher algorithms, a caesar cipher and a Vigenere cipher. Caesar cipher takes a string and shifts all letters by a single key value. So if k=1 and the character in the string is a it becomes b etc and z becomes a. Vigenere cipher uses a keyword to vary the amount that each letter gets shifted (a or A is 0, b or B is 1, etc). For example, if the current letter in the keyword is b and the plaintext letter is p the cipher text character is q. The program is expected to run as follows: (Note: matching the text exactly is important and points will be taken off if your program doesnt).

>./caesar 1 Enter the plaintext: defend the east wall of the castle! Cipher text is: efgfoe uif fbtu xbmm pg uif dbtumf! 
>./vigenere fortification Enter the plaintext: defend the east wall of the castle! Cipher text is: iswxvi bje xigg boce wk bje viggqs! 

II. Error Checkin

A. Caesarcipher:possibleerrorsthatcanoccurisamissingcommandlineargument or a command line argument that isn't a number.

A. ErrormessageshouldbeUsage:caesar[key]thenquit B. VigenereCipher:possibleerrorscouldbethatthereisamissingkeywordora

keyword containing symbols or numbers. A. ErrormessageshouldbeUsage:vignetter[keywordcontainingonlyletters]

then quit

III. Grading

Functionality of Caesar: 30% (half will be awarded for code that compiles that is an attempt at a solution) Functionallity of Vigenere: 40% (half will be awarded for code that compiles that is an attempt at a solution)

Style: 30%

IV. Submission

Submit a single zip file ciphers.zip containing caesar.c, vigenere.c and an optional README.txt (if there is anything that I should know when grading) to the MyCourses Dropbox by the deadline.

Due Date: 11/28 at 11:59pm

V. Remarks

- Must use pointers to keep your current place in the plaintext and keywords - Only letters should be encrypted. Numbers and other non letters shouldn't be shifted. - Assume plaintext is 19 characters of text or less. - Lecture code is your friend.

VI. References

https://en.wikipedia.org/wiki/Caesar_cipher

http://practicalcryptography.com/ciphers/caesar-cipher/

https://en.wikipedia.org/wiki/Vigenere_cipher http://practicalcryptography.com/ciphers/classical-era/vigenere-gronsfeld-and-autokey/

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

Step: 3

blur-text-image

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

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions