Caesar cipher - Password Encryption Practical
#include<stdio.h>
#include<string.h>
int main()
{
char password[20];
int i, len=0;
printf("Enter your password:");
scanf("%s",password);
len = strlen(password);
printf("Your encrypted password is: ");
for(i=0; i<len; i++)
printf("%c",password[i]+3);
return 0;
}
Output of program
Enter your password:ABCD
Your encrypted password is: DEFG
int main()
{
char password[20];
int i, len=0;
printf("Enter your password:");
scanf("%s",password);
len = strlen(password);
printf("Your encrypted password is: ");
for(i=0; i<len; i++)
printf("%c",password[i]+3);
return 0;
}
Output of program
Enter your password:ABCD
Your encrypted password is: DEFG
See the below link for Caesar Cipher code in c++, python and java
ReplyDeletehttp://code2begin.blogspot.in/2017/09/data-decryption-using-caesar-cipher.html
I got an error msg saying that strlen was not declared in this scope
ReplyDeletePlease share your complete program code to locate point of error.
DeleteAlso, share the OS name and software used by you to run this code.
You can send details through Contact Us form given at the bottom.
use string.h in header
Delete