Shop OBEX P1 Docs P2 Docs Learn Events
Creating a password — Parallax Forums

Creating a password

josh.tjosh.t Posts: 1
edited 2010-02-28 23:28 in BASIC Stamp
I'm looking for hints on what kind of code (BS2) I'd need to come up with to store a password as a word variable, and then store a typed in (attempted) password from a 4x4 keypad.
For example, the stored (correct) password is '12345'. I am prompted to enter a five digit password on the LCD. I enter 12345, the BS2 compares it to the stored password, then I move on to a different part of the code, an 'options' screen or the like.
So far, I've got the 4x4 keypad working flawlessly, and I can read the digits I push on my parallax LCD readout. (4x20, I think)

The code that I'm using is all sorts of messed up, I know, so I wont even attempt to put it up and get ridiculed for it... This is one of those 'learning experiences.'
So if anyone has any ideas, I'm game for them! I've been looking through manuals and online documents for two days trying to figure this out... mad.gif

Thanks!

Comments

  • Adrian SchneiderAdrian Schneider Posts: 92
    edited 2010-01-18 08:39
    As you say "The code that I'm using is all sorts of messed up", go and fix that first before even you dream of proceeding any further.

    Regards
    Adrian
  • Oper8r AlOper8r Al Posts: 98
    edited 2010-01-18 12:08
  • HiveMindHiveMind Posts: 3
    edited 2010-02-28 23:28
    Just one word of advice concerning·the IF statement that verifies the password.
    If you are going to have a variable for verification, one that changes upon the validity of the entered password, then make sure that if you enter the right program, the variable is set to = 0, and if you enter the wrong password, it sets the variable = 1.
    So, in theory:

    Someone comes up to the keypad and enters the wrong variable, the program realizes this and then, sets the validity variable = 1.
    and IF statement sees that the validity variable = 1 and then denies the person access.


    The Reason:
    Historically, if someone really wants to just get in through your password, they could use a buffer overflow, which, allows them to force verification by inserting a huge string of characters which basically is converted to a positive number and forced to be = 1 because the memory allowance for the variable was only = 0 or 1, so this enabled access, however, simply by requiring validity = 0 can this be avoided.
Sign In or Register to comment.