Anonymous committed 76cab40

use sha instead of crypt to decrease suckage for windows users. also crypt kinda blows anyway

Comments (0)

Files changed (1)


 """ - handles user login and validation"""
 import random, string
-    from crypt import crypt
-    try:
-        from fcrypt import crypt
-    except:
-        raise "Need fcrypt module on non-Unix platform:"
+from sha import sha
 administrator = 'admin'
 user = 'user'
 def cryptpw(password, salt=None):
     if salt is None:
         salt = string.join([chr(random.randint(ord('a'), ord('z'))), chr(random.randint(ord('a'), ord('z')))],'')
-    return crypt(password, salt)
+    return sha(password + salt).hexdigest()
 def checkpw(password, dbpw):
     return cryptpw(password, dbpw[:2]) == dbpw