Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Caecar Cipher decryption write a C program that: can decrypt a plain text with punctuation mark. The output should be encrypted text messages (with a
Caecar Cipher decryption write a C program that: can decrypt a plain text with punctuation mark. The output should be encrypted text messages (with a maximum length of 256 characters) requests the desired key from the user (make sure that key > 0 and key < 26), outputs the read messages encrypted on the console. The program should use certain C features and the following functions to implement: Define an enum state with two values: "encrypted" and "decrypted" Define a struct message with three fields: char payload[256]; // Max length 256, messages can too be shorter unsigned int length; // Defines the actual length of the Strings in payload enum state encryptionState; // Defines whether the message in payload is encrypted or decrypted Implement at least: int readMessage(FILE* fp, struct message* m, enum state encryptionState); void writeMessage(FILE* fp, struct message* m); void printMessage(struct message* m); void encrypt(struct message* m, unsigned int distance); void decrypt(struct message* m, unsigned int distance); void caesarCipher(struct message* m, int distance);
please provide the code and the output result
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started