how to encrypt and decrypt a data in c
#include<stdio.h>
void encrypt(char *c){
char *ptr = c;
while(*ptr!= '\0'){
*ptr = *ptr + 2;
ptr++;
}
}
int main()
{
char c[] = "nilabhru come on amd fuck me";
encrypt(c);
printf("Encrypted string is: %s",c);
return 0;
}
#include<stdio.h>
void decrypt(char *c){
char *ptr = c;
while(*ptr!= '\0'){
*ptr = *ptr - 2;
ptr++;
}
}
int main()
{
char c[] = "pkncdjtw eqog qp cof hwem og";
decrypt(c);
printf("Decrypted string is: %s",c);
return 0;
}
Comments
Post a Comment