Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebird: How to make an md5 hash?

Tags:

firebird

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?

like image 807
coderama Avatar asked Jul 29 '13 14:07

coderama


People also ask

How is MD5 created?

MD5 was designed by Ronald Rivest in 1991 to replace an earlier hash function MD4, and was specified in 1992 as RFC 1321. One basic requirement of any cryptographic hash function is that it should be computationally infeasible to find two distinct messages that hash to the same value.

What is MD5 hash generator?

The MD5 hashing algorithm uses a complex mathematical formula to create a hash. It converts data into blocks of specific sizes and manipulates that data a number of times. While this is happening, the algorithm adds a unique value into the calculation and converts the result into a small signature or hash.

How long does it take to generate MD5 checksum?

It generally takes 3-4 hours to transfer via NC and then 40 minutes to get the md5sum. The security of the hash is not an issue in this case.

How does MD5 hash work?

The MD5 (message-digest algorithm) hashing algorithm is a one-way cryptographic function that accepts a message of any length as input and returns as output a fixed-length digest value to be used for authenticating the original message.


1 Answers

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).

like image 55
ain Avatar answered Oct 14 '22 10:10

ain