Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 22 APR 2001 11:51:50AM Bob Silverstein wrote:

I am using MSG to enter a password and I want to mask the password. Can I do so in the string of parameters passed to the second argument of the MSG function?

I am trying to limit access to a menu with the password.

Thanks!


At 22 APR 2001 12:07PM Donald Bakke wrote:

Bob,

One approach is to simply make the foreground color of the input to be the same as the background color of the prompt.

[email protected]

SRP Computer Solutions, Inc.


At 23 APR 2001 08:39AM WinWin/Revelation Technical Support wrote:

Bob-

You can try this-

*—

* get the user's password to run this process

*—

GET_PW:

RESP='

ECHO OFF

MSG('Password','RCI',RESP,) ECHO ON ENTERED=RESP IF ENTERED=CHAR(27) THEN GOTO WRAPUP IF ENTERED=' THEN GOTO WRAPUP CHECK=XLATE('MY_ACCESS_DATA',@USERNAME,1,'X') IF ENTERED=CHECK ELSE MESS=The password entered is not the correct|' MESS:= 'password for user ':@USERNAME:'.|Try again, or press Escape to quit' MSG(MESS) GOTO GET_PW END Hope it helps- MIke </QUOTE> —- === At 23 APR 2001 09:13AM Don Miller - C3 Inc. wrote: === <QUOTE>Bob .. The normal drill for this is: GET.PSW: PSWD=' OK=0 ECHO OFF MSG('Enter Your Access Password','RI',PSWD,)

 ECHO ON
 READ PSWDS FROM PSWDS_FILE ELSE
      USER.PSWD='
 END
 LOCATE PSWD IN PSWDS USING @FM SETTING POS THEN
     USER.PSWD=PSWDS
 END ELSE USER.PSWD='
 IF POS THEN OK=1 ; RETURN

I usually store my passwords in a file that contains a series of valid passwords. the 'RI' parameter uses INPUT_CHAR to get the data entry. The @ECHO off prevents display of what's typed.

Don Miller

C3 Inc.


At 23 APR 2001 12:15PM C CHRISTIE wrote:

The previous responses are perfectly good ways to HIDE completely the password being entered. If however you really mean you want to MASK the entry (e.g. with asterisks) so that the user can see how many characters there are and backspace/edit effectively, then you might consider using a simple collector with a single prompt which uses a user defined conversion to display any entry as a string of *'s of the same length. This is actually nastier than it sounds, and you may ultimately end up needing a replace-scribe process for full control.

We've gone to these lengths because we use a LOT of internal password security in our system, but it's probably overkill if your need is a one-off…

FWIW,

Cameron


At 24 APR 2001 05:17AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

A generic AREV password routine, crudely constructed for your needs, FWIW


expendable subroutine password

declare subroutine input.char, video.rw

leftarrow.key=\004B\
rightarrow.key=\004D\
backspace.key=\08\
enter.key=\0D\
escape=\1B\
ok.password=ABCDEFGHIJKLMNOPQRS'
convert @lower.case to @upper.case in ok.password

keys.entered=0
trial.password='
IMG='
VIDEO.RW(0,0,@crtWide - 1,@crtHigh - 1,"R",IMG)
txt=Enter password ':@FM:@FM
call msg(txt:SPACE(len(ok.password)),'UB',IMG,IMG)

loop
while keys.entered  len(ok.password)+1
pressed='
input.char(pressed)
convert @lower.case to @upper.case in pressed
begin case
case pressed=backspace.key
  if keys.entered ] 0 then
   print @((40-INT(len(ok.password)/2)-1+keys.entered),13):@EW:' '
    keys.entered -= 1
    trial.password-1,1='
  end
case pressed=leftarrow.key
  if keys.entered ] 0 then
   print @((40-INT(len(ok.password)/2)-1+keys.entered),13):@EW:' '
    keys.entered -= 1
    trial.password-1,1='
  end
case pressed=escape
  if pressed=escape then
    VIDEO.RW(0,0,@crtWide - 1,@crtHigh - 1,"W",IMG)
    return
  end
case pressed=enter.key
  if trial.password=ok.password then
    * SUCCESS - proceed to passworded system feature here
    call msg('success')
    VIDEO.RW(0,0,@crtWide - 1,@crtHigh - 1,"W",IMG)
    return
  end else
    * defeat
    call msg( 'bad password','','','')
    VIDEO.RW(0,0,@crtWide - 1,@crtHigh - 1,"W",IMG)
    return
  end
case 1
if index(@upper.case:'1234567890 ',pressed,1) then
  trial.password := pressed
  keys.entered += 1
 print @((40-int(len(ok.password)/2)-1+(keys.entered)),13):@EW:'*'
end
end case
repeat

VIDEO.RW(0,0,@crtWide - 1,@crtHigh - 1,"W",IMG)
return

The Sprezzatura Group

World Leaders in all things ***

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/ebd6a9f9760794b685256a36005724e9.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1