Pages

Friday, February 19, 2016

Program to encrypt password using Caesar cipher.


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

4 comments:

  1. See the below link for Caesar Cipher code in c++, python and java
    http://code2begin.blogspot.in/2017/09/data-decryption-using-caesar-cipher.html

    ReplyDelete
  2. I got an error msg saying that strlen was not declared in this scope

    ReplyDelete
    Replies
    1. Please share your complete program code to locate point of error.

      Also, 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.

      Delete