Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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?

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions