Link to home
Start Free TrialLog in
Avatar of darrenteo82
darrenteo82

asked on

md5

hi i want to get a password input from the user and then it is stored as md5 hash in a file. The md5 is then check whether it matches the password entered by the user.

dict = {}
if(dict.has_key(user)):

      f = open("test", "w")
      line2 = f.readline()[:-1]

      while f:
         dict[line[1]] = md5.md5(passWord)
         f.write(dict[line2[1]].digest())
         line = f.readline()[:-1]

      if (dict[line2[1]] == pwd):
         do something

i am not sure the above is correct. any help is of use thanks.
ASKER CERTIFIED SOLUTION
Avatar of ramrom
ramrom
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
confusedmoron: I am disappointed that darrenteo8 has not responded. I has hoped to nudge him toward self-dependence in writing and debugging code. I'm not sure giving him a solution is the best approach, but who knows.

darrenteo8 - is any of the above helpful? We'd like to hear from you!

Bob Gailer
Page Editor
Avatar of confusedmoron
confusedmoron

I've always liked to have a working example of things I didn't understand. That why I could look at it and fully understand what was going on. Otherwise I would find myself throwing bits of code in until it works and never fully understanding why it works.
Personal preference I guess.
Would love to hear from darrenteo8!