I am using DCPcrypt and SHA512 to hash strings.
I am using the version by Warren Postma https://bitbucket.org/wpostma/dcpcrypt2010
It is working fine. However it failes with german umlauts like ä, ö, ü and probably other unicodes.
I am using the library like this:
function TForm1.genhash(str: string): string;
var
Hash : TDCP_sha512;
Digest: array[0..63] of byte;
i: integer;
s: string;
begin
s:= '';
hash := TDCP_sha512.Create(nil);
if hash<>nil then
begin
try
Hash.Init;
Hash.UpdateStr(str);
Hash.Final(Digest);
for i:= 0 to length(Digest)-1 do
s:= s + IntToHex(Digest[i],2);
finally
hash.free;
end;
end;
Result := s;
end;
When i input the letter ä
i expect the output to be:
64868C5784A6004E675BCF405F549369BF607CD3269C0CAC1711E21BA9F40A5ABBF0C7535856E7CF77EA55A072DD04AA89EEA361E95F497AA965309B50587157
I checked it with those sites: http://hashgenerator.de/ http://passwordsgenerator.net/sha512-hash-generator/
However i get:
1A7F725BD18E062020A646D4639F264891368863160A74DF2BFC069C4DADE04E6FA854A2474166EED0914B922A9D8BE0C89858D437DDD7FBCA5C9C89FC07323A
So my question is: How can i use the DCPcrypt library to generate hashes for german umlauts? THanks