Encryption And Decryption Of Code Using C Language | Encryption of Code | Coding With Roannie | C |
#include<stdio.h>
void encrypt(char *code){
char *ptr = code;
while(*ptr != '\0')
{
*ptr = *ptr+1;
ptr++;
}
}
int main() {
char code[1000];
printf("Enter The Code You Want To Encrypt : \n");
gets(code);
encrypt(code);
printf("Your Encrypted Code Is : %s", code);
return 0;
}
///***DECRPTED CODE :
#include<stdio.h>
void encrypt(char *code){
char *ptr = code;
while(*ptr != '\0')
{
*ptr = *ptr-1;
ptr++;
}
}
int main() {
char code[1000];
printf("Enter The Code You Want To Decrypt : \n");
gets(code);
encrypt(code);
printf("Your Decrypted Code Is : %s", code);
return 0;
}