PASSWORD PLEASE
Intro ::....
This program deals with the passwords.... U can know the entire details if u just compile them... This is just a sample program to just make u understand the basic concept.... U can use this program anywhere with some modifications as per ur necessity....
Source Code ::...
/*PROGRAM TO DEAL WITH PASSWORD*/
#include stdio.h
#include conio.h
#include process.h
#include ctype.h
FILE *fp;
int i,j,c[10],opt,pa;
char a[10]=" ",b[10]=" ";
void pass();
void main()
{
g:clrscr();
printf("\n\n\n\t\tENTER YOUR OPTION\n\n\n\n\t1.CHECK PASSWORD\n\n\n\t2.CHANGE PASSWORD\n\n\t");
scanf("%d",&opt);
switch(opt)
{
case 1:
{
fp=fopen("pass.txt","r");
fgets(b,20,fp);
fscanf(fp,"%d",&i);
fclose(fp);
pa=i;
clrscr();
printf("\n\n\n\tPASSWORD PLEASE\n\n\n\t");
for(i=0;i<=20;i++)
{
a[i]=getch();
c[i]=toascii(a[i]);
if(c[i]==13)
{
pass();
exit(0);
}
else
printf("*");
}
}
case 2:
{
clrscr();
printf("\n\n\n\n\tENTER YOUR NEW PASSWORD\n\n\t");
for(i=0;i<=20;i++)
{
b[i]=getch();
c[i]=toascii(b[i]);
if(c[i]==13)
{
fp=fopen("pass.txt","w+");
fprintf(fp,"%s\n%d",b,i);
fclose(fp); goto g;
}
else printf("*");
}
}
}
}
void pass()
{
int k=0;
for(j=0;j<=i;j++)
{
if(a[j]==b[j])
k++;
}
if(pa==i&&k==pa)
printf("\n\n\n\n\n\t\tWELCOME U HAVE ENTERED THE RIGHT PASSWORD");
else
printf("\n\n\n\n\n\n\t\tCHECK YOUR PASSWORD");
getch();
}
Merits ::...
* This program is very helpful as this can be attached with any of ur other programs to improve ur security....
* I personally didnt find any exceptional cases here...
* U can set ur password to any number of digits as passwords... It may contain alphabets digits or numbers...
Sample Output ::....
U can try this out by your self by clicking the link below..... Its really funny... The default password is "vignesh"......
http://www.ziddu.com/download.php?uid=Zqydl5mnZa%2BdlZzzZ6qZnJGla6eZlZ2saA%3D%3D5
http://www.ziddu.com/download.php?uid=aqyam5yub6uZmZTza6qZnJGlb6eZlZ2qbg%3D%3D9
Look Out ::...
This program can be run on any C compiler as this is a C program... Your comments are always welcomed....