Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: display text as stars (password)  (Read 18804 times)

0 Members and 1 Guest are viewing this topic.

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: display text as stars (password)
« Reply #15 on: December 05, 2009, 04:06:05 PM »
Logical error, password was not defined. Otherwise, it works if password was already defined in the system earlier.

password is not a variable, there is nothing to define. password is a literal. Setting the password to password was perhaps a poor choice although it seemed inspired at the time.

I made a few changes for the critics among you: (but the password is still password) :P

Code: [Select]
@echo off
setlocal
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>hide.com

:retry
set /p userid=Enter UserId:
set /p pass=Enter password: < nul
for /f "tokens=*" %%i in ('hide.com') do set pass=%%i
if /i .%pass%==.password goto next
cls
echo Try again. You are not logged in!
goto retry

:next
echo. & echo You are logged in!
del hide.com
endlocal

 8)

Salmon is right, anybody serious about security would never use a batch file to authenticate a password. Hide.com is actually an assembled debug script which shuts off echoing on the command line, but at some point the password entered has to be compared to the actual password and this is where anybody that can read batch code can learn the password.
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: display text as stars (password)
« Reply #16 on: December 05, 2009, 06:08:26 PM »
Sidewinder,
You are right!
Where can I find the source code for hide.com ?


Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: display text as stars (password)
« Reply #17 on: December 05, 2009, 06:56:06 PM »
Where can I find the source code for hide.com ?

Code: [Select]

Your Message here


I decided to take the source code down. The assembled code is in the batch file, so someone imaginative should be able to produce the source code. Good luck.  8)
« Last Edit: December 06, 2009, 07:57:47 AM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

pds



    Beginner
  • konichiwa kamisan ^_^
  • Thanked: 2
    Re: display text as stars (password)
    « Reply #18 on: December 13, 2009, 04:53:20 AM »
    Is there a command or value too, like if  your password is 3 times incorrect wait 1 day?

    ghostdog74



      Specialist

      Thanked: 27
      Re: display text as stars (password)
      « Reply #19 on: December 13, 2009, 05:26:54 AM »
      Is there a command or value too, like if  your password is 3 times incorrect wait 1 day?

      what are you trying to do actually? manually hand crafting password control with batch?? If you want to do the above, you have to set policies

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: display text as stars (password)
      « Reply #20 on: December 13, 2009, 10:04:55 AM »
      MS does not recommend using batch to manage passwords.
      If you really need it, you will have to learn to read
      programs in C++ and study the work of others.
      Quote
      MS-CHAP Password Management API
      Purpose
      The MS-CHAP Password Management API makes it possible to use MS-CHAP to change user passwords. Windows programmers can use this API to create applications to change the passwords of networked users on remote workstations.
      http://msdn.microsoft.com/en-us/library/ms697873(VS.85).aspx

      pds



        Beginner
      • konichiwa kamisan ^_^
      • Thanked: 2
        Re: display text as stars (password)
        « Reply #21 on: December 14, 2009, 08:13:53 AM »
        i also do