home *** CD-ROM | disk | FTP | other *** search
- {
- * Written and compiled in turbo pascal by:
- David Eisner
-
-
- This program:
-
- - is for anyone's use
-
- - will die after three unsuccessful attempts at entry
-
- - will only accept one (1) system identifier (always)
- one (1) user name (current)
- one (1) password (current)
-
- but can easily be modified to accept more
-
- - has default string arguments of 10
- except for system identifier which is 15
-
- - * has no facility for dos shell protection and might
- be circumvented by a ctrl-c / break before program
- execution begins
-
- to help, turn break off in your autoexec.bat file
- as a first line command, execute security, then turn
- break on
-
- - is therefore intended as a first-step / demonstration
- pascal security utility with window use
-
- }
-
- program SECURITY(input,output);
- {$U-}
- {$C-}
- type
- res = record
- ax,bx,cx,dx,bp,si,di,ds,es,flags: integer;
- end;
- var
- x1, x2, y1, y2: integer;
- tx,ty: integer;
- d,i: integer;
- access: boolean;
- count: integer;
- usr: string[10];
- paswd: string[10];
- who: string[15];
- nam, pas: string[10];
- r: res;
- p1: text;
- procedure delay;
- begin
- for i:= 1 to 31000 do
- for d:= 1 to 2 do
- begin end;
- end;
- procedure frame;
- begin
- x1:= 1;
- x2:= 30;
- y1:= 2;
- y2:= 6;
- clrscr;
- gotoxy(x1+1,y1);
- for tx:= x1+1 to x2-1 do
- write(chr(196));
- gotoxy(x1+1,y2);
- for tx:= x1+1 to x2-1 do
- write(chr(196));
- gotoxy(x2,y1);
- for ty:= y1+1 to y2-1 do
- begin
- gotoxy(x2,ty);
- write(chr(179))
- end;
- gotoxy(x1,y1);
- for ty:= y1+1 to y2-1 do
- begin
- gotoxy(x1,ty);
- write(chr(179))
- end;
- gotoxy(x1,y1);
- write(chr(218));
- gotoxy(x2,y1);
- write(chr(191));
- gotoxy(x1,y2);
- write(chr(192));
- gotoxy(x2,y2);
- write(chr(217));
- gotoxy(x1+9,y1);
- write(who);
- gotoxy(x1+5,y2);
- write('system ');
- textcolor(15+16);
- write('authorization');
- textbackground(4);
- gotoxy(x1+1,y1+1);
- for i:= x1+1 to x2-1 do
- write(chr(32));
- window(x1+1,y1+1,x2-1,y2-1)
- end;
- procedure getuser;
- begin
- clrscr;
- textcolor(15);
- writeln;
- write('user: ');
- read(usr);
- clrscr;
- writeln;
- write('password: ');
- textcolor(4);
- read(paswd);
- end;
- procedure verify;
- begin
- if (usr = nam) and (paswd = pas) then
- access:= true;
- end;
- procedure result;
- begin
- clrscr;
- if access = true then
- begin
- clrscr;
- writeln;
- textcolor(15);
- write('access: ');
- textcolor(15+16);
- write('CONFIRMED');
- textcolor(15);
- end
- else
- begin
- count:= count +1;
- if count = 4 then
- begin
- clrscr;
- textcolor(15);
- gotoxy(10,2);
- write('GOODBYE !');
- inline($50/$53/$51/$52/$56/$57/$1E/$06/$FB);
- r.di:= 1;
- intr(1,r);
- inline($07/$1F/$5F/$5E/$5A/$59/$5B/$58/$8B/$E5/$5D/$CF);
- {termination}
- end;
- clrscr;
- textcolor(15);
- writeln;
- write('access: ');
- textcolor(15+16);
- write('DENIED');
- textcolor(15);
- delay;
- clrscr;
- getuser;
- verify;
- result;
- end
- end;
- begin{main}
- assign(p1,'security.pwd');
- reset(p1);
- readln(p1,who); { system identifier }
- readln(p1,nam); { the user }
- readln(p1,pas); { user's password }
- close(p1);
- access:= false;
- count:= 1;
- clrscr;
- frame;
- getuser;
- verify;
- result;
- textmode;
- window(1,1,80,25);
- writeln;
- writeln;
- writeln;
- end.{main}
-