Saturday, October 28, 2017

Password Security in Clipper Summer '87

Here is another password security program that I wrote a very long time using Nantucket Clipper Summer '87 to protect the database from intruders.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.


Program Listing

* Password.Prg
* Clipper Summer '87
* Author : Jake R. Pomperada
* Date : January 14, 2001

Set Talk Off
Set Echo Off
Set Scoreboard Off
Set Safety Off
Set Escape Off
Set Procedure To Shadow
Set Procedure To Sha_Attr
Clear Typeahead
Clear screen
@ 01,01 To 23,80 double
Set Color To
@ 02,02,22,78 Box Replicate(Chr(177),80)
Set Color To
Set Color to W/BG
@ 03,16 Clear To 09,65
@ 03,16 To 09,65
Shadow(03,16,09,65)
Title1 = "General Manager :  James Smith"
Title2 = "WEST BAR AND RESTAURANT PAYROLL SYSTEM"
Title3 = "Bacolod City"
Title4 = "Developed By: SERVO Software Unlimited."
DateNow = CMonth(date()) + Chr(32) + Str(day(date()),2) +;
          ',' +Chr(32) + Str(Year(Date()), 4)
Set Color to GR+/BG
@ 4,Int(80-Len(Title2))/2 Say Title2
Set Color To
Set Color To W+/BG
@ 5,Int(80-Len(Title3))/2 Say Title3
Set Color To G+/Bg
@ 6,Int(80-Len(Title1))/2 Say Title1
Set Color To W+/Bg
@ 7,Int(80-Len(DateNow))/2 Say DateNow
Set Color To
Set Color To GR/Bg
@ 8,Int(80-Len(Title4))/2 Say Title4
Set Color To
Set Color To W/N
@ 13,20 Clear To 15,60
@ 13,20,15,60 Box "°°°°°°"
Shadow(13,20,15,60)
Set Color To
I = 0
Do While .T.
Set Color To W+/N
@ 14,22 Say Space(38)
@ 14,22 Say "Enter Password :::::"
xxx = Password("JAKE",Chr(237))
if i = 3
For X = 1 To 25
 Scroll(00,00,24,40,1)
 Scroll(00,41,24,79,-1)
 inkey(.1)
Next X
Set Cursor Off
 Warning1 = "SORRY YOU CANNOT ACCESS THE SYSTEM. ASK FOR THE CORRECT"
 Warning2 = "PASSWORD AND TRY AGAIN. GOOD LUCK !!!"
 Title3   = "SERVO Software Unlimited 2001"
Set Color To W/Bg+
 @ 1,1 Clear To 5,75
 @ 1,1 To 5,75 Double
 Set Color To
 Set Color to GR+/Bg
 @ 2,Int(80-Len(Warning1))/2 Say Warning1
 @ 3,Int(80-Len(Warning2))/2 Say Warning2
 Set Color To
   Tone(440,1)
   Tone(392,2)
   Tone(349,1)
   Tone(626,1)
   Tone(209,1)
   Tone(102,1)
 Set Color to G+*/BG+
 @ 4,Int(80-Len(Title3))/2 Say Title3
 Set Color To
 @ 7,1 Say " "
Set Cursor On
  Quit
endif
if !xxx
   i = i + 1
   Set Cursor Off
   Setcolor("W/BG")
   @ 18,08 Clear To 20,75
   @ 18,08 To 20,75
   Shadow(18,08,20,75)
   Set Color To R+/Bg
   Title1 = "  WARNING !!! INTRUDER DETECTED IN THE SYSTEM.  ACCESS DENIED."
   @ 19,int(80-LEN(Title1))/2 Say Title1
   Set Color To
   Tone(261,2)
   Tone(349,1)
   Tone(493,2)
   Tone(440,1)
   Tone(392,2)
   Tone(349,1)
   Tone(329,1)
   Tone(311,2)
   delay=inkey(1)
   Set Color To
   @ 18,07 Say Replicate(Chr(177),71)
   @ 19,07 Say Replicate(Chr(177),71)
    @ 20,07 Say Replicate(Chr(177),71)
    @ 21,07 Say Replicate(Chr(177),71)
  Set Color To
     SEt Cursor On
   loop
  else
  Set Color To
   clear
 *  do menu
   @ 00,00 Say "Okey!!!"
  quit
   endif
   enddo

   Function Password
   Para str1,charrepl
   private dummy,ch,row,col,len
   col = col()
   row = row()
   dummy = ""
   len = len(str1)
   do while .T.
   ch = inkey(0)
   do case
    case ch = 8 .or. ch = 19
     if (len(dummy) > 0)
      dummy = substr(dummy,1,len(dummy)-1)
      endif
      case Isalpha(chr(ch))
       if (len(dummy) < len)
       dummy = dummy + chr(ch)
       else
       dummy = stuff(dummy,len(dummy),len(dummy),chr(ch))
       endif
       case ch = 13
       exit
       case ch = 27
       exit
       Endcase
        @ row,col Say space(len)
       @ row,col say Replicate(charrepl,len(dummy))
       enddo
       if upper(dummy) = str1
       return .t.
       else
       return .f.
       endif

      Procedure Shadow
      para t,l,b,r
      Private black,White,DR_gray,;
      Col_Shadow_Attribute,BW_Shadow_Attribute,;
      Shadow_Attribute
      Black   = 1
      White   = 7
      DR_Gray = 8
      Col_Shadow_Attribute = (DR_Gray) + (Black)
      BW_Shadow_Attribute =  (White) + (Black)
      if IsColor()
         Shadow_Attribute = Col_Shadow_Attribute
      Else
      Shadow_Attribute = BW_Shadow_Attribute
       endif
      Sha_Attr(b+1,l+2,b+1,r+2,shadow_Attribute)
      Sha_Attr(t+1,r+1,b+1,r+2,shadow_Attribute)
return

Procedure Sha_Attr
Para t,l,b,r,new_attr
private old_scr_area, new_scr_area,i
old_scr_area = SaveScreen(t,l,b,r)
new_scr_area = ""
For I = 1 to Len(Old_scr_area) Step 2
   new_scr_area = New_scr_area + Substr(old_scr_area,i,1)+;
   chr(new_attr)
   next
   RestScreen(t,l,b,r,new_scr_area)
   return
    

Login Security in Clipper Summer 87

Here is a sample program that I wrote more than 20 years ago a login security program that I wrote using Clipper Summer '87 I hope you find my work useful.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.


Program Listing

login.prg

save screen to sPassword

clear

cUser = space(10)
cPwds = 'fctc      bacolod   ±'
nTrys = 0

@ 10,27 say 'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ '
@ 11,27 say '³ Login User :            ³Û'
@ 12,27 say '³ Password   :            ³Û'
@ 13,27 say 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ'
@ 14,27 say '  ßßßßßßßßßßßßßßßßßßßßßßßßßß'

do while .t.

    set color to w/n,w/n,,,w/n

    @ 11,42 get cUser valid .not. empty(cUser)
    read

    if lastkey() = 27
        lAccess = .f.
        exit
    endif

    set confirm on
    set color to x/x
    set cursor off
    set intensity off

    cKeys = space(10)
    @ 12,42 get cKeys picture '@S1' valid .not. chr(177) $ cKeys
    read

    set confirm off
    set color to
    set cursor on
    set intensity on

    nTrys = iif(lastkey()#27,nTrys+1,nTrys)

    do case
        case lastkey() = 27
            lAccess = .f.
            exit
        case cUser+cKeys $ cPwds
            select 100
            use users
            locate for user = cUser
            if .not. found()
                append blank
            endif
            replace user with cUser,;
                    date with date(),;
                    time with time()
            lAccess = .t.
            exit
        case nTrys > 2
            clear
            set color to w+
            @ 12,27 say 'A C C E S S  D E N I E D ...'
            set colo to
            tone(300,1)
            tone(499,5)
            tone(700,5)
            inkey(5)
            lAccess = .f.
            exit
    endcase

enddo

restore screen from sPassword

return

* --- EOF

Fare Solver in Turbo Pascal

In this article I would like to share with you a very simple program that I wrote a very long time ago in Turbo Pascal to compute the fare of the user.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.



Program Listing

program proj;
uses crt;
var i : integer;

procedure pass;
var
   status:string;
      name,dest,acc:string[30];
      date:integer;

  begin
   {repeat}
   writeln('Fare Solver in Turbo Pascal');
   writeln('Name');
   readln(name);
   writeln('Status');
   read(status);
   writeln('Destination');
   readln(dest);
   writeln('Date');
   readln(date);
   writeln('Accomodation');
   readln(acc);
   Case status of
   begin
    'student': begin
               if acc == 'Cabin' then
                 begin
                  if dest == 'Manila' then
                    pay = 1500.00 * .2
                   else if dest = 'Cebu' then
                    pay = 1000.00 * .2
                   else if dest = 'Cagayan' then
                    pay = 2000.00 * .2
                   if dest == 'Davao' then
                    pay = 1800.00 * .2
                   else if dest = 'Zamboanga' then
                    pay = 2500.00 * .2
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .2
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
                else if acc ='Tourist' then
                    begin
                  if dest == 'Manila' then
                    pay = 1200.00 * .2
                   else if dest = 'Cebu' then
                    pay = 800.00 * .2
                   else if dest = 'Cagayan' then
                    pay = 1500.00 * .2
                   if dest == 'Davao' then
                    pay = 1600.00 * .2
                   else if dest = 'Zamboanga' then
                    pay = 2000.00 * .2
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .2
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
               else if acc == 'Tatami' then
                 begin
                  if dest == 'Manila' then
                    pay = 1000.00 * .2
                   else if dest = 'Cebu' then
                    pay =500.00 * .2
                   else if dest = 'Cagayan' then
                    pay = 1100.00 * .2
                   if dest == 'Davao' then
                    pay = 1300.00 * .2
                   else if dest = 'Zamboanga' then
                    pay = 1500.00 * .2
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .2
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
                else if acc = 'Econom' then
                    begin
                  if dest == 'Manila' then
                    pay = 800.00 * .2
                   else if dest = 'Cebu' then
                    pay = 300.00 * .2
                   else if dest = 'Cagayan' then
                    pay = 900.00 * .2
                   if dest == 'Davao' then
                    pay = 1000.00 * .2
                   else if dest = 'Zamboanga' then
                    pay = 1000.00 * .2
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .2
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
    'child': begin
               if acc == 'Cabin' then
                 begin
                  if dest == 'Manila' then
                    pay = 1500.00 * .5
                   else if dest = 'Cebu' then
                    pay = 1000.00 * .5
                   else if dest = 'Cagayan' then
                    pay = 2000.00 * .5
                   if dest == 'Davao' then
                    pay = 1800.00 * .5
                   else if dest = 'Zamboanga' then
                    pay = 2500.00 * .5
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .5
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
                else if acc ='Tourist' then
                    begin
                  if dest == 'Manila' then
                    pay = 1200.00 * .5
                   else if dest = 'Cebu' then
                    pay = 800.00 * .5
                   else if dest = 'Cagayan' then
                    pay = 1500.00 * .5
                   if dest == 'Davao' then
                    pay = 1600.00 * .5
                   else if dest = 'Zamboanga' then
                    pay = 2000.00 * .5
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .5
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
               else if acc == 'Tatami' then
                 begin
                  if dest == 'Manila' then
                    pay = 1000.00 * .5
                   else if dest = 'Cebu' then
                    pay =500.00 * .5
                   else if dest = 'Cagayan' then
                    pay = 1100.00 * .5
                   if dest == 'Davao' then
                    pay = 1300.00 * .5
                   else if dest = 'Zamboanga' then
                    pay = 1500.00 * .5
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .5
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
                else if acc = 'Econom' then
                    begin
                  if dest == 'Manila' then
                    pay = 800.00 * .5
                   else if dest = 'Cebu' then
                    pay = 300.00 * .5
                   else if dest = 'Cagayan' then
                    pay = 900.00 * .5
                   if dest == 'Davao' then
                    pay = 1000.00 * .5
                   else if dest = 'Zamboanga' then
                    pay = 1000.00 * .5
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .5
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
     'Senior': begin
               if acc == 'Cabin' then
                 begin
                  if dest == 'Manila' then
                    pay = 1500.00 * .3
                   else if dest = 'Cebu' then
                    pay = 1000.00 * .3
                   else if dest = 'Cagayan' then
                    pay = 2000.00 * .3
                   if dest == 'Davao' then
                    pay = 1800.00 * .3
                   else if dest = 'Zamboanga' then
                    pay = 2500.00 * .3
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .3
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
                else if acc ='Tourist' then
                    begin
                  if dest == 'Manila' then
                    pay = 1200.00 * .3
                   else if dest = 'Cebu' then
                    pay = 800.00 * .3
                   else if dest = 'Cagayan' then
                    pay = 1500.00 * .3
                   if dest == 'Davao' then
                    pay = 1600.00 * .3
                   else if dest = 'Zamboanga' then
                    pay = 2000.00 * .3
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .3
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
               else if acc == 'Tatami' then
                 begin
                  if dest == 'Manila' then
                    pay = 1000.00 * .3
                   else if dest = 'Cebu' then
                    pay =500.00 * .3
                   else if dest = 'Cagayan' then
                    pay = 1100.00 * .3
                   if dest == 'Davao' then
                    pay = 1300.00 * .3
                   else if dest = 'Zamboanga' then
                    pay = 1500.00 * .3
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .3
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
                else if acc = 'Econom' then
                    begin
                  if dest == 'Manila' then
                    pay = 800.00 * .3
                   else if dest = 'Cebu' then
                    pay = 300.00 * .3
                   else if dest = 'Cagayan' then
                    pay = 900.00 * .3
                   if dest == 'Davao' then
                    pay = 1000.00 * .3
                   else if dest = 'Zamboanga' then
                    pay = 1000.00 * .3
                   else if dest = 'Iloilo' then
                    pay = 300.00 * .3
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
       'Regular': begin
               if acc == 'Cabin' then
                 begin
                  if dest == 'Manila' then
                    pay = 1500.00
                   else if dest = 'Cebu' then
                    pay = 1000.00
                   else if dest = 'Cagayan' then
                    pay = 2000.00
                   if dest == 'Davao' then
                    pay = 1800.00
                   else if dest = 'Zamboanga' then
                    pay = 2500.00
                   else if dest = 'Iloilo' then
                    pay = 300.00
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
                else if acc ='Tourist' then
                    begin
                  if dest == 'Manila' then
                    pay = 1200.00
                   else if dest = 'Cebu' then
                    pay = 800.00
                   else if dest = 'Cagayan' then
                    pay = 1500.00
                   if dest == 'Davao' then
                    pay = 1600.00
                   else if dest = 'Zamboanga' then
                    pay = 2000.00
                   else if dest = 'Iloilo' then
                    pay = 300.00
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
               else if acc == 'Tatami' then
                 begin
                  if dest == 'Manila' then
                    pay = 1000.00
                   else if dest = 'Cebu' then
                    pay =500.00
                   else if dest = 'Cagayan' then
                    pay = 1100.00
                   if dest == 'Davao' then
                    pay = 1300.00
                   else if dest = 'Zamboanga' then
                    pay = 1500.00
                   else if dest = 'Iloilo' then
                    pay = 300.00
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
                else if acc = 'Econom' then
                    begin
                  if dest == 'Manila' then
                    pay = 800.00
                   else if dest = 'Cebu' then
                    pay = 300.00
                   else if dest = 'Cagayan' then
                    pay = 900.00
                   if dest == 'Davao' then
                    pay = 1000.00
                   else if dest = 'Zamboanga' then
                    pay = 1000.00
                   else if dest = 'Iloilo' then
                    pay = 300.00
                   else
                    writeln (' NOT IN SERVICE ')
                  end;
          writeln('Total Payable:', pay);
          readln
          end;
    end;
   { until keypressed == chr(27);}
 {main}
  begin
   pass;
   readln;
  end.

Password in Turbo Pascal

Here is a very old code that I wrote during my college day using Turbo Pascal as my programming language it is a password program. The code is very simple and easy to understand.

I am currently accepting programming work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.


Program Listing

Program  password;
uses crt;
var
w,i:integer;
pass,a:string[12];
try:char;
name:string;
begin
repeat
 randomize;
 textbackground(black);
 clrscr;
 gotoxy(32,6);
 write('P A S S W O R D');
 gotoxy(27,7); write('旼컴컴컴컴컴컴컴컴컴컴컴커');
 gotoxy(27,8); write('?                       ?);
 gotoxy(27,9); write('읕컴컴컴컴컴컴컴컴컴컴컴켸');
 textcolor(black);
 gotoxy(29,8);readln(pass);
 textcolor(white);
 gotoxy(20,12); write('Verifying password ');
  for i:=40 to 60 do
  begin
    gotoxy(i,12);
    sound(random(1000+i));

    write('');
    delay(7000);
  end;
 if pass = 'admin' then
  begin
   clrscr;
   gotoxy(12,20);
   write(' You are one of the authorized person(s) ');
  end;
  nosound;
 if pass <> 'admin' then
  begin
   clrscr;
   gotoxy(31,12);  write('Wrong Password');
   gotoxy(25,14);write('Do you want another try Y/N : ');
  end;
  nosound;
   readln(try);
until (try = 'N') or (try = 'n');
readln;
end.