You are not logged in Log in Join
You are here: Home » Members » element » crypttols » View File

Log in
Name

Password

 

crypttols

File details
Size
1 K
File type
text/plain

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