The goal of my assignment is to create a program that takes a string of words and encodes or decodes the string using a simple substitution cypher.
I've gotten a decent amount done but I am stuck at the part where I actually have to encrypt and decrypt using the offset that the user has input.
This is what I have, can anybody lend a hand?
include <stdio.h>
int main () {
#include <stdio.h>
int main () {
char alpha[26] = "abcdefghijklmnop";
char ALPHA[26] = "ABCDEFGHIJKLMNOP";
char*encrypt(char*str,int offset);
char*decrypt(char*str,int offset);
int option;
int offset;
char str;
char toencode(int alpha, int ALPHA);
char todecode(int alpha, int ALPHA);
printf("Select an option.\n");
printf("1. Encrypt File\n");
printf("2. Decrypt File\n");
scanf("%d",&option);
if(option == 1)
printf("Encrypting\n");
else if(option == 2)
printf("Decrypting\n");
else{
printf("invalid entry\n");
return 0;
}
printf("Please enter a number for the offset.");
scanf("%d",&offset);
while(1)
{
printf("Type entry to encrypt.\n");
scanf("%s", &str);
return 0;
}