You have chosen to sponsor your bid up to a maximum amount of .
I Need Password encryption for login Form , i used web2py before and this was a built in function , i asked the framework maker about how can i implement it and he answered this :
The logic is very complex because it needs to deal with many options and not-break backward compatibility.
Normally an encrypted password looks like
algorithm$salt$hash algorithm$$hash (no salt) hash (legacy)
the hash is computing using the algorithm, the salt, and optionally a user provided key. The key is unique. The salt is different for each password.
Every time you call CRYPT()('password') you get a LazyCrypt object. This object can be serialized into a string. The string you get is always different because it contains a random salt. You cannot compare two of those strings because you always get false, even for the same password. Yet you can compare a LazyObject with a string and the lazy object will use the same algorithm and the same salt from the string to compute the hash and compare it with the hash in the string. Example:
>>> a = CRYPT()('password')
>>> b = CRYPT()('password')
>>> sa = str(a)
>>> sb = str(b)
>>> sa == sb
>>> a == sb
>>> c = CRYPT()('wrong')
>>> c == sb
attached is the class for the function to make that in python , what i wont is to implement this in php ,