I want to update all passwords in the DB to have a MD5 hashes password. The following doesn't solve my problem:
UPDATE USERS SET USERPASS = hash('SALT' || USERPASS);
Problem being: it returns a hash that was not generated using the MD5 algorithm. How can I impliment the md5 hash algorithm in Firebird?
The next version of Firebird, Firebird 4, will add cryptographic hash functions. To quote from the Firebird 4 Beta 1 release notes:
Firebird 4 Beta 1 can be downloaded for testing from https://www.firebirdsql.org/en/firebird-4-0-0-beta1/
Unfortunately the algortihm of the
hash
function is not mentioned in the documentation... anyway, you can implement it as an UDF or use some thirdparty UDF lib which implements it. There is a list of UDF Libraries for Firebird on the IBPhoenix website and it seems that both rFunc and FreeAdhocUDF library have one (I only checked these two, there is probably others).