Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Mar : Re: MD5 Encryptyon
| Subject: | Re: MD5 Encryptyon |
| Posted by: | "Rabatscher Michael" (m.rabatsch..@tom-medical.com) |
| Date: | Wed, 12 Mar 2008 11:57:22 |
adv schrieb:
> It's possible to encrypt (MD5 encryption) a string with a Indy objet??
Not encrypt but hash the string.
Look into IdHashMessageDigest and the
TidHashMessageDigest5 class.
short example:
var md5Hash : TIdHashMessageDigest5;
hash : T4x4LongWordRecord;
begin
md5Hash := TIdHashMessageDigest5.Create;
try
hash := md5Hash.HashValue('yourtexthere');
Result := IntToHex(Integer(hash[0]), 4) + '-' +
IntToHex(Integer(hash[1]), 4) + '-' +
IntToHex(Integer(hash[2]), 4) + '-' +
IntToHex(Integer(hash[3]), 4);
finally
md5Hash.Free;
end;
end;
kind regards
Mike
none