Copyright © Programs ++
Design by Dzignine
Saturday, 11 February 2012

Basic password encryption program

Password encryption is basically converting a password in some other format(instead of text) into a format
that is not recognizable,so that i becomes secure. This is essential when we want to write down passwords without
the fear of having to risk the likelihood of revealing our password. Also since encrypted passwords contain special characters
such as %,$ , it becomes very difficult for brute force attacks to crack it. There are many password encrypters  available, that use
sophisticated techniques to encrypt passwords. One simple method is by converting a series of characters into their respective ASCII
values. The program given below encrypts the password as follows :

Step1 : The user enters a password to encrypt
Step2 : The password is checked to see whether it is UPPERCASE OR LOWERCASE
Step3 : If it is lowercase then it is converted into uppercase and vice-verse
Step4 : Then the converted string is converted into ASCII. Vola, the password is encrypted and contains only numeric values

Even though this encryption method is very simple, it is effective especially against a person who little knowledge of ASCII values.

// BASIC PASSWORD ENCRYPTER
// USES ASCII CODES FOR ENCRYPTION
// VERSION 1.0
// CREATED BY : DEEPAK SHARMA

#include <iostream>
#include <cctype>

int main()
{
     char password[20];
     char temp[20];
     int encrypt_password[20];
     int i,length;
     std::cout<<" Enter the password to encrypt (max 20 characters ) : ";
     std::cin.getline(password,sizeof(password));
      // to check whether the password is in UPPERCASE or LOWERCASE
     for (i=0; password[i] != '\0'; i++ )
     {
           if ( islower(password[i]) )
                    temp[i] = toupper(password[i]);
           else if ( isupper(password[i]) )
                    temp[i] = tolower(password[i]);
          else
                    temp[i] = password[i];
      } //end of loop
             temp[i] = '\0';

     // to convert the characters to their respective ASCII values
      for ( i=0; temp[i] != '\0'; i++ )
      {
               encrypt_password[i] = temp[i];
      }
        length = i;
      // to display the encrypted password

      std::cout<<"\n ENTERED PASSWORD : "<<password;

      std::cout<<" \n\n ENCRYPTED PASSWORD : ";
      for (i=0; i<length; i++)
      {
          std::cout<<encrypt_password[i];
      }

     return 0;
} // end of main
Basic password encrypter version 1.0









---

2 comments:

Comment Here....