I am working on a registration system for a 3rd party server, and (though tank auth's hashing is great), I need an md5 (so the third party software can check against it). Is there an easy way to do this?
开发者_高级运维Thanks, Max
If you want to do it the right way, you would write your own hash functions to use in Tank_Auth and remove the current ones.
If you don't want to do it the right way, Tank_Auth uses the included phpass PasswordHash
class to hash and validate passwords. Only two functions are called from the Tank_Auth library: CheckPassword
and HashPassword
. Make a backup, and rewrite these two functions to use md5()
instead. You may simply ignore the configuration and other PasswordHash
methods.
PHP has a built in md5 hashing function ( md5() ), although I'd recommend sha1 ( sha1() ) over md5.
edit: ah, you're required to use an md5 hash is what you're saying? then just md5()
精彩评论