i already did a program that encrypts letters by skipping 1 or 2. but now i need to make a program that encrypts a word, using substitution. I already try several things but i can't get it work. can anybody help me?
for example the normal key is a,b,c,d,e
and the secret key is f,g,h,i,j.
the program prompts the user to enter a word using the letters in the secret key. and then outputs the word using the normal key.
for example: enter the secret key: f,g,h,i,j
enter a word in the secret key: ggijf
your word is: bbda
code:
#include <stdio.h>
int main()
{
char abracadabra[] = {'a','b','c','d','e'}
char secret_key[] = {'f','g','h','i','j'}
char new_word[] = {"ggijf"}
for(i=0; i<5; i++)
{
secret_key[i] = abracadabra[i];
new_word[i] = secret_key[i];
}
for(i-0; i<5; i++)
printf("your word is: %c", new_word[i]);
return 0;
}