Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
