Advertisement
7_2009-2012 Security #226667

A password program with a small difference

Yet another password program!! This one takes into account the backspace key, a feature which i didn't find in the other password programs on this site.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
#include<iostream.h>
#include<conio.h>
void main() 
{
clrscr();
cout<<"Enter password: \n";
restart:int x[100],x1[100],i,j=0,k=0,l;
for(i=0;i<=100;i++) 
  {
  shahab:l=getch();
  if(((l>=48)&&(l<=126))||(l==8)||(l==13))x[i]=l;
  else goto shahab;
  if(x[i]==13)break; 
  else if(x[i]==8) 
      {
      gotoxy(1,2);
      clreol();
      for(i=0;i<100;i++)
      x[i]='\0';
      goto restart;
      }
  else
    {
    cout<<"*";
    k++;
    }
  }
cout<<"\nRe enter password: \n"; 
for(i=0;i<=k;i++) 
  {
  x1[i]=getche();
  if(x1[i]==13)break;
  }
for(i=0;i<=k;i++)
if(x[i]!=x1[i])j++; if(j==0)cout<<"\nPasswords match!!\n"; 
else cout<<"\nPasswords do not match!!\n";
getch();
}
Upload
Original Comments (3)
Recovered from Wayback Machine