Jonathan Ellis  committed 76cab40

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

  • Participants
  • Parent commits 7afd5ab
  • Branches rel_0_4

Comments (0)

Files changed (1)

File test/zblog/

 """ - 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