Friday, March 16, 2018

DELPHI - How get MD5 hash value for string (RSA-MD5 fingerprint)

Hash function returns same value for same string. This uses RSA-MD5 algorithm.
uses IdHashMessageDigest;
...
var
  pMD5: TIdHashMessageDigest5;
begin
  pMD5 := TIdHashMessageDigest5.Create;
  try
    ShowMessage( 'abc = ' + pMD5.HashStringAsHex( 'abc' ) + #13 +
                 'abc = ' + pMD5.HashStringAsHex( 'abc' ) + #13 +
                 'abd = ' + pMD5.HashStringAsHex( 'abd' ) );
  finally
    pMD5.Free;
  end;
Output:

3 comments:

  1. hi Josef Pirkl ...
    please how to revers a string biuld by pMD5 ?. thanks advance.

    ReplyDelete
  2. Is't not possible to reverse a MD5 hash to the original string.

    ReplyDelete
  3. BTS5huR9R5VhfdWnVXFxVFNUkxs9A5zrwVjQuvhxY9kV2Ny83hQA6

    ReplyDelete