What would the SQL statement be to validate a password if the MySql table that looks like this:
user_id password salt
------- -------- ----
1 23ed2... m9f3m...
I tried:
select * from password_table
where user_id = 1
and password = shal(`salt` + 'password')
order by id desc
limit 1
which did not return anything. The algorithm is sha512 whirlpool.
In php it goes like this:
hash('sha512', hash('whirlpool', $password));
It is possible that it can't be done in an sql statement.