Question: The Caesar cipher is a simple encryption method which works by swapping each letter with another one a certain offset away in the alphabet. For

The Caesar cipher is a simple encryption method which works by swapping each letter with another one a certain offset away in the alphabet. For example, with an encryption offset of 1, "abc" woudl be encrypted as "bcd"

Instead of restricting the Cipher to the alphabetic Characters only, we will use all the printable ASCII characters. Your program must work with the printable ASCII character set. That is, all the characters from ASCII 32 (Space) to ASCII 126 (~). When the offset points to a character beyond 126 it should wrap around to the beginning of the set.

In C program, create a function called caesar_decrypt that takes two parameters, a string (character array) to decrypt and an int giving the offset that was used to encrypt. The function should display the decrypted string

For example: caesar_decrypt("def",2) should display "abc".

Caesar_decrypt("~30J<@4.6J=0/J1:CJ5@8;>J:A0=J?30J7,EDJ-=:B9J/:2",42)

Should display "The quick red fox jumps over the lazy brown dog".

You should no write a main() function and assume all #include statements and main functions have been implemented

Step by Step Solution

3.40 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a C program for the caesardecrypt funct... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!