Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String hashing function that will produce identical results in Delphi and PHP

I need a string hashing function that will produce identical results in Delphi XE2 and PHP. What are my options? Preference will be given to a free, simple and cryptographically secure solution.

like image 771
Shannon Matthews Avatar asked May 05 '12 05:05

Shannon Matthews


People also ask

What is an example of using Delphi to generate a hash?

One example of this is when downloading a program online. If the software distributor gives out the MD5 hash of the file, you can produce the hash using Delphi and then compare the two values to make sure they're the same.

What is hashing algorithm in PHP?

This algorithm is one of the powerful hashing algorithms which calculates the md5 hash i.e. the hash of 16 or 32-character hexadecimal number of a particular string. This string passed will be converted into the encrypted hexadecimal form. The above syntax indicated the $string as the input string.

How to compare strings with a hash function?

So usually we want the hash function to map strings onto numbers of a fixed range [ 0, m), then comparing strings is just a comparison of two integers with a fixed length. And of course, we want hash ( s) ≠ hash ( t) to be very likely if s ≠ t. That's the important part that you have to keep in mind.

What is the use of hashed string in hashing?

This function is used to copy the hashing context. The string passed as an input to the function is hashed by one of the algorithms used in hash_init () function and the corresponding output would be the hashed string which is passed to this function. This function returns a hashed form of the output given by the hash_init function.


1 Answers

You can try the SHA1, crc32 or md5 algorithms all these are part of the PHP core and also exist a lot of Delphi implementations.

  • PHP sha1, crc32, md5
  • Delphi Delphi Encryption Compendium (DEC) (MD5, SHA-1)
  • Delphi SynCrypto (MD5, SHA-1)
  • Delphi TurboPower LockBox (MD5, SHA-1)
  • Delphi JwsclCryptProvider unit part of the Jwscl library (JEDI Windows Security Code Lib) (MD5, SHA-1)
like image 152
RRUZ Avatar answered Sep 25 '22 06:09

RRUZ