crypttols
File contents
def encrypt_password_forsql(self, clear_password): """encrypt a password for SQL""" import crypt, random encryptedpass = str(crypt.crypt(clear_password,'ab')) return encryptedpass def compare_passwords_forsql(self, clear_password, crypt_password): """ Validate an encrypted password """ import crypt, random if crypt.crypt(clear_password,'ab')==crypt_password: return 1 else: return 0