Guest User

Untitled

a guest
Feb 12th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. import hashlib as hash
  2.  
  3. def login(user, hash_pass):
  4.     m = hash.md5()
  5.     m.update(b"%s" % hash_pass)
  6.     tempPass = m.hexdigest()
  7.     f = open("approved.tapFile",'r').readlines().strip("\n")
  8.     for x in f:
  9.         if x == user+":"+tempPass:
  10.             return True
  11.             break
  12.  
  13. def registrer(user,hash_pass):
  14.     m = hash.md5()
  15.     m.update(b"%s" % hash_pass)
  16.     tempPass = m.hexdigest()
  17.     f = open("request.tapFile",'a')
  18.     f.write(user+":"+tempPass+"\n")
  19.     f.flush()
  20.  
  21. def approve(user):
  22.     f = open("approved.tapFile",'r').readlines().strip("\n")
  23.     f1 = open("request.tapFile",'r').readLines().strip("\n")
  24.     for x in f1:
  25.         for y in f:
  26.             if x[0:x.find(":")] == user and not y[0:y.find(":")] == user:
  27.                 f = open("approved.tapFile",'a')
  28.                 f.write(x + "\n")
  29.                 f.flush()
  30.                 return True
  31.             else:
  32.                 return False
Add Comment
Please, Sign In to add comment