Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Password program

case sensitive

  • Please log in to reply
7 replies to this topic

#1 h2o pete

h2o pete

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 15 November 2011 - 05:34 AM

Hi,

Making a password program in TASM for a project. Bit stuck at the moment, hoping someone can help.

I need to accept the password "blank". At the moment it does, but I need it to be non case sensitive. Any ideas how I could do that?

Ideally, I also need it to cover up the password with "******" when it is entered. Had a search around on the internet and can't seem to find anything. Can someone point me in the right direction?

Thanks!


Here's my code so far:

AHHHHHHH

Edited by h2o pete, 08 December 2011 - 05:14 AM.

  • 0

#2 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 15 November 2011 - 08:08 PM

To make the password case-insensitive, create a function called toupper that converts any character you give it to uppercase if it's alphabetic, and call that for each of your input characters.

Instead of using int 21H/AH=1, use int 16H/AH=0 to capture a keystroke. It won't echo anything, so you can print '*' each time.
  • 0

sudo rm -rf / && echo $'Sanitize your inputs!'


#3 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 15 November 2011 - 10:05 PM

Hmmm... How do you "un-print" a character (like if the input character is 8)?
  • 0

#4 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 15 November 2011 - 11:16 PM

Do you mean add a backspace functionality?
  • 0

sudo rm -rf / && echo $'Sanitize your inputs!'


#5 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 16 November 2011 - 12:46 AM

Yeah, something like that.

I think I've done something similar before, when plain .com files used to work on the older computer (when it had Windows XP on it; now it has Ubuntu). The thing I did was output 8, which would move the cursor left, then output a 32, and then repeat step 1 to move the cursor left again. At least that's what I remember doing.
  • 0

#6 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 16 November 2011 - 11:01 AM

What do you mean by "output 8?" Why don't you just use interrupts (or port commands)?
  • 0

sudo rm -rf / && echo $'Sanitize your inputs!'


#7 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1311 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 16 November 2011 - 04:53 PM

By "output" I didn't mean "use the out instruction" ; I mean, (if I remember how to do this right)
mov ah, 2 

mov dl, 8 

int 0x21

  • 0

#8 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 16 November 2011 - 05:22 PM

Oooh, okay. It'd be better to use interrupt 0x10, subfunctions 2 and 3. I wouldn't count on your method working everywhere.
  • 0

sudo rm -rf / && echo $'Sanitize your inputs!'






Also tagged with one or more of these keywords: case sensitive

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download