alexinoa
asked on
I want to know how to use DCPCrypt v2
I do not know anything about encryption...
i have this function:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ------
function getDigest(str:string):ansi String;
var
Hash : TDCP_sha256;
Digest: array[0..31] of byte;
i: integer;
s: ansiString;
begin
s:= '';
hash := TDCP_sha256.Create(nil);
if hash<>nil then
begin
try
Hash.Init; // initialize it
Hash.UpdateStr(str); // hash the stream contents
Hash.Final(Digest); // produce the digest
for i:= 0 to length(Digest)-1 do
s:= s + IntToHex(Digest[i],2);
finally
hash.free;
end;
end;
result := s;
end;
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----
which returns me a hash string to store in a table/database.
actually it works very good in 256 bits, i think so, but i want to upgrade my function to 512 bits.
how can i do that please??
i have this function:
--------------------------
function getDigest(str:string):ansi
var
Hash : TDCP_sha256;
Digest: array[0..31] of byte;
i: integer;
s: ansiString;
begin
s:= '';
hash := TDCP_sha256.Create(nil);
if hash<>nil then
begin
try
Hash.Init; // initialize it
Hash.UpdateStr(str); // hash the stream contents
Hash.Final(Digest); // produce the digest
for i:= 0 to length(Digest)-1 do
s:= s + IntToHex(Digest[i],2);
finally
hash.free;
end;
end;
result := s;
end;
--------------------------
which returns me a hash string to store in a table/database.
actually it works very good in 256 bits, i think so, but i want to upgrade my function to 512 bits.
how can i do that please??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.