Question: I'm trying to decrypt a simple caesar cipher as well as trying to find the initial offset. The output works as expected except that the

I'm trying to decrypt a simple caesar cipher as well as trying to find the initial offset. The output works as expected except that the offsets having to do with the edge of the string is not behaving correctly. In picture of my output, the 12th character should be 'h' as that is what the first offset from 'P' is since 'P' is at the right end of the keystring and 'h' is at the left end. I'm assuming I did something wrong with the if-statement maybe? But I'm not sure, can someone tell me whats going on with my program?

I'm trying to decrypt a simple caesar cipher as well as trying

to find the initial offset. The output works as expected except that

the offsets having to do with the edge of the string is

not behaving correctly. In picture of my output, the 12th character should

Here is a picture or some of my output for reference

#include void offsetFunction(char[],char*[]); int main() int keyStringSize = 65; int cipherTextSize = 44; char keyString[65] = "hXTFexn39AJ6cmCYgktNuUWBd LKL4R1DSQTH y5q.8VpjIZMGIVEfaso'wob72zP", char cipherText [44] = "V4RVB3J286pPvQwsnWuqeOivcYvMLEQEDEwy lo.d45F"; char* decrypted [44]; int increment = 0; for (int index1 = 0; index1 64) newIndex -= 65; keyText[index] = keyText (newIndex]; printf("Offset: %d, Result: ", offset); for(int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!