tags:

views:

50

answers:

1

Hi lynn, Can u pls help me for the below issue.

I have sha1 value in mssql table (Password is encrypted using algorithm SHA1 which provided in Microsoft .Net library) .

I created one php application, in that i need to compare these encrypted value.

Thanks

+2  A: 

I suppose you want to compare a user provided password with the hashed value from the database. In that case, just use the native php sha1 function:

if($hashedPasswordFromDB == sha1($plainUserProvidedPassword)) {
    echo "Approved!";
}
else {
    echo "Denied!";
}
Treur
And you must be lynn.
GregS
This one not working .I already tried...
josh
Could you provide some more debug info? i.e. The output of sha1($plainUserProvidedPassword) and the output of $hashedPasswordFromDB?
Treur