Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

neEd help in creating PASSWORD taSm pRogram.....

burandayburanday Member Posts: 3
pls..kindly help me in creating a TASM program which allow me
to input a 8-10 PASSWORD i want to use "BURANDAY" as my PASSWORD..
and the input password should be in a ASTERISK.. and if the PASSWORD is CORRECT it will display "ACCESS GRANTED" but if the PASSWORD iS INCORRECT it will display "ACCESS DENIED"...

pLs..help me..pls reply me.....




Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : pls..kindly help me in creating a TASM program which allow me
    : to input a 8-10 PASSWORD i want to use "BURANDAY" as my PASSWORD..
    : and the input password should be in a ASTERISK.. and if the PASSWORD
    : is CORRECT it will display "ACCESS GRANTED" but if the PASSWORD iS
    : INCORRECT it will display "ACCESS DENIED"...
    :
    : pLs..help me..pls reply me.....
    :
    [color=Blue]
    You should begin doing something. Write a program which will print text "PASSWORD: " on the screen. When it works, add some code which will allow to enter characters one by one. Once character entered - you will print an asterisk. Store characters in a simple buffer. When ENTER is pressed - check the buffer against valid password key using repeated (a loop) CMP instruction.

    You will need these materials:

    [link=http://www.ctyme.com/intr/rb-2562.htm]http://www.ctyme.com/intr/rb-2562.htm[/link]

    [link=http://www.ctyme.com/intr/rb-2561.htm]http://www.ctyme.com/intr/rb-2561.htm[/link]

    [link=http://www.ctyme.com/intr/rb-2554.htm]http://www.ctyme.com/intr/rb-2554.htm[/link]
    [/color]
  • burandayburanday Member Posts: 3
    : : pls..kindly help me in creating a TASM program which allow me
    : : to input a 8-10 PASSWORD i want to use "BURANDAY" as my PASSWORD..
    : : and the input password should be in a ASTERISK.. and if the PASSWORD
    : : is CORRECT it will display "ACCESS GRANTED" but if the PASSWORD iS
    : : INCORRECT it will display "ACCESS DENIED"...
    : :
    : : pLs..help me..pls reply me.....
    : :
    : [color=Blue]
    : You should begin doing something. Write a program which will print
    : text "PASSWORD: " on the screen. When it works, add some code which
    : will allow to enter characters one by one. Once character entered -
    : you will print an asterisk. Store characters in a simple buffer.
    : When ENTER is pressed - check the buffer against valid password key
    : using repeated (a loop) CMP instruction.
    :
    : You will need these materials:
    :
    : [link=http://www.ctyme.com/intr/rb-2562.htm]http://www.ctyme.com/intr
    : /rb-2562.htm[/link]
    :
    : [link=http://www.ctyme.com/intr/rb-2561.htm]http://www.ctyme.com/intr
    : /rb-2561.htm[/link]
    :
    : [link=http://www.ctyme.com/intr/rb-2554.htm]http://www.ctyme.com/intr
    : /rb-2554.htm[/link]
    : [/color]



    [color=Green]sir..wat is the meaning of dis one DS:EDX ..?

    and if ever i will create a program for password i will compare it per character..??? so you min sir i will use mov ah,1...???
    i hav already made a program for that but im not sure if it will run..

    sir is it possible to use the function mov ah,0ah..??? base on my research it will accept a data from the keyboard..??

    sir thank you and godbless...^-^[/color]



  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : : : pls..kindly help me in creating a TASM program which allow me
    : : : to input a 8-10 PASSWORD i want to use "BURANDAY" as my PASSWORD..
    : : : and the input password should be in a ASTERISK.. and if the PASSWORD
    : : : is CORRECT it will display "ACCESS GRANTED" but if the PASSWORD iS
    : : : INCORRECT it will display "ACCESS DENIED"...
    : : :
    : : : pLs..help me..pls reply me.....
    : : :
    : : [color=Blue]
    : : You should begin doing something. Write a program which will print
    : : text "PASSWORD: " on the screen. When it works, add some code which
    : : will allow to enter characters one by one. Once character entered -
    : : you will print an asterisk. Store characters in a simple buffer.
    : : When ENTER is pressed - check the buffer against valid password key
    : : using repeated (a loop) CMP instruction.
    : :
    : : You will need these materials:
    : :
    : : [link=http://www.ctyme.com/intr/rb-2562.htm]http://www.ctyme.com/intr
    : : /rb-2562.htm[/link]
    : :
    : : [link=http://www.ctyme.com/intr/rb-2561.htm]http://www.ctyme.com/intr
    : : /rb-2561.htm[/link]
    : :
    : : [link=http://www.ctyme.com/intr/rb-2554.htm]http://www.ctyme.com/intr
    : : /rb-2554.htm[/link]
    : : [/color]
    :
    :
    :
    : [color=Green]sir..wat is the meaning of dis one DS:EDX ..?
    :
    : and if ever i will create a program for password i will compare it
    : per character..??? so you min sir i will use mov ah,1...???
    : i hav already made a program for that but im not sure if it will
    : run..
    :
    : sir is it possible to use the function mov ah,0ah..??? base on my
    : research it will accept a data from the keyboard..??
    :
    : sir thank you and godbless...^-^[/color]
    :
    [color=Blue]
    DS:EDX means an address. The offset of the address in 32-bit register EDX and segment selector is in register DS. When you program for DOS - usually you need 16-bit registers and that will be register DX (without 'E'), so the address will actually look like DS:DX. It is your responsibility to load the DS register and in TASM it should go like this (at the very beginning of the code):
    [/color]
    [code]
    mov ax, @data
    mov ds, ax
    [/code]
    [color=Blue]
    If your program is COM instead of EXE file, then you do not need to set the DS - all registers are set to PSP by the DOS loader - much simpler then EXE file.

    The comparison of strings can be done in that way:
    [/color]
    [code]
    ;
    ; Both texts (user input and password) should be terminated by zero byte
    ;
    mov si,

    mov di,

    mov cx,
    repe cmpsb
    je password_accepted

    ;
    ; Password did not match
    ;
    [/code]
    [color=Blue]
    Function AH=0Ah will allow the user input, but that input will be visible on screen. What you need is to read a character from keyboard WITHOUT showing it, then show this character '*' instead of every symbol entered by user as user enters them. You need a simple loop:
    [/color]
    [code]
    - Prepare an address for a buffer

    1. Get a character from keyboard
    2. If this char is ENTER then go to step 5
    3. Store the char in a buffer and move the buffer address 1 byte forward
    4. Print '*' on screen and go to step 1

    5. Store zero byte in buffer
    6. Do comparison of text here...

    [/code]
  • burandayburanday Member Posts: 3
    : : : : pls..kindly help me in creating a TASM program which allow me
    : : : : to input a 8-10 PASSWORD i want to use "BURANDAY" as my PASSWORD..
    : : : : and the input password should be in a ASTERISK.. and if the PASSWORD
    : : : : is CORRECT it will display "ACCESS GRANTED" but if the PASSWORD iS
    : : : : INCORRECT it will display "ACCESS DENIED"...
    : : : :
    : : : : pLs..help me..pls reply me.....
    : : : :
    : : : [color=Blue]
    : : : You should begin doing something. Write a program which will print
    : : : text "PASSWORD: " on the screen. When it works, add some code which
    : : : will allow to enter characters one by one. Once character entered -
    : : : you will print an asterisk. Store characters in a simple buffer.
    : : : When ENTER is pressed - check the buffer against valid password key
    : : : using repeated (a loop) CMP instruction.
    : : :
    : : : You will need these materials:
    : : :
    : : : [link=http://www.ctyme.com/intr/rb-2562.htm]http://www.ctyme.com/intr
    : : : /rb-2562.htm[/link]
    : : :
    : : : [link=http://www.ctyme.com/intr/rb-2561.htm]http://www.ctyme.com/intr
    : : : /rb-2561.htm[/link]
    : : :
    : : : [link=http://www.ctyme.com/intr/rb-2554.htm]http://www.ctyme.com/intr
    : : : /rb-2554.htm[/link]
    : : : [/color]
    : :
    : :
    : :
    : : [color=Green]sir..wat is the meaning of dis one DS:EDX ..?
    : :
    : : and if ever i will create a program for password i will compare it
    : : per character..??? so you min sir i will use mov ah,1...???
    : : i hav already made a program for that but im not sure if it will
    : : run..
    : :
    : : sir is it possible to use the function mov ah,0ah..??? base on my
    : : research it will accept a data from the keyboard..??
    : :
    : : sir thank you and godbless...^-^[/color]
    : :
    : [color=Blue]
    : DS:EDX means an address. The offset of the address in 32-bit
    : register EDX and segment selector is in register DS. When you
    : program for DOS - usually you need 16-bit registers and that will be
    : register DX (without 'E'), so the address will actually look like
    : DS:DX. It is your responsibility to load the DS register and in TASM
    : it should go like this (at the very beginning of the code):
    : [/color]
    : [code]:
    : mov ax, @data
    : mov ds, ax
    : [/code]:
    : [color=Blue]
    : If your program is COM instead of EXE file, then you do not need to
    : set the DS - all registers are set to PSP by the DOS loader - much
    : simpler then EXE file.
    :
    : The comparison of strings can be done in that way:
    : [/color]
    : [code]:
    : ;
    : ; Both texts (user input and password) should be terminated by zero byte
    : ;
    : mov si,

    : mov di,

    : mov cx,
    : repe cmpsb
    : je password_accepted
    :
    : ;
    : ; Password did not match
    : ;
    : [/code]:
    : [color=Blue]
    : Function AH=0Ah will allow the user input, but that input will be
    : visible on screen. What you need is to read a character from
    : keyboard WITHOUT showing it, then show this character '*' instead of
    : every symbol entered by user as user enters them. You need a simple
    : loop:
    : [/color]
    : [code]:
    : - Prepare an address for a buffer
    :
    : 1. Get a character from keyboard
    : 2. If this char is ENTER then go to step 5
    : 3. Store the char in a buffer and move the buffer address 1 byte forward
    : 4. Print '*' on screen and go to step 1
    :
    : 5. Store zero byte in buffer
    : 6. Do comparison of text here...
    :
    : [/code]:




    [color=Blue]
    sir...how to store zero to the buffer???

    and in this [/color] [color=Red][/color] why does it have plus 1 (+1) at the end of this??

    what is the purpose of this...???

    tenkz...



  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : [color=Blue]
    : sir...how to store zero to the buffer???
    :
    : and in this [/color] [color=Red][/color] why does it have plus 1 (+1) at the end of this??
    :
    : what is the purpose of this...???
    :
    : tenkz...
    :
    :
    :
    :
    [color=Blue]Load the buffer location into address register (DI for example) and then store zero byte at that address:
    [/color]
    [code]
    mov di,

    mov byte ptr [di], 0
    [/code]
    [color=Blue]+1 in the count needed so you do not get the mismatch like this one:
    [/color]
    [code]
    REAL PASSWORD: "CODE"
    ENTERED PASSWORD: "CODES"
    [/code]
    [color=Blue]In the above example the length of entered password is 4. If you use it in CX register to compare passwords you get a false positive result - the code will say that these texts are equal, however you can see that they are different. You have to include the terminating zero byte (which you stored at the end of input, right?) into search. That is why CX must be loaded with LENGTH+1.[/color]
  • SirPoSirPo Member Posts: 1
    [color=Orange][italic]sir..wat is the meaning of dis one DS:EDX ..?

    and if ever i will create a program for password i will compare it per character..??? so you min sir i will use mov ah,1...???
    i hav already made a program for that but im not sure if it will run..

    sir is it possible to use the function mov ah,0ah..??? base on my research it will accept a data from the keyboard..??

    sir thank you and godbless...^-^[/italic][/color]



    It is really irritating too read a filipino programmer sound like an idiot on the internet. You my friend pare give us all a bad name.

Sign In or Register to comment.