#1
|
||||
|
||||
Delphi Encryption Compendium HAVAL Modification
I have been working with the Delphi Encryption Compendium lately and made a small change to the HAVAL hash function to allow you to specify rounds. The author originally had fixed round types for each length.
Download: Code:
http://rghost.net/8qktp6spV Code:
Uses DECHash, DECFmt; Function GetHAVAL_Ansi(input: ansistring):String; var val:tstringstream; hash: tHash_haval128; len:int64; Begin val:=tstringstream.Create; len:=length(input); val.Write(input[1],Len); val.Seek(0, soFromBeginning); DECHash.sHavalRounds:=4; hash:=thash_haval128.Create(); result:=string(hash.CalcStream(val,Len,TFormat_HEX)); //output is rawbytestring. We must cast it to string type. hash.Free; val.Free; End; Function GetHAVAL_unicode(input: unicodestring):String; var val:tstringstream; hash: tHash_haval128; len:int64; Begin val:=tstringstream.Create; len:=length(input)*2; val.Write(input[1],Len); val.Seek(0, soFromBeginning); DECHash.sHavalRounds:=4; //Specify the rounds here... hash:=thash_haval128.Create(); result:=string(hash.CalcStream(val,Len,TFormat_HEX)); //output is rawbytestring. We must cast it to string type. hash.Free; val.Free; End;
__________________
"As the island of our knowledge grows, so does the shore of our ignorance." John Wheeler |
The Following 2 Users Gave Reputation+1 to chessgod101 For This Useful Post: | ||
Kjacky (08-29-2015), Storm Shadow (08-31-2015) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Delphi Encryption Compendium v3.0 Problem | winndy | General Discussion | 1 | 02-18-2006 10:12 |
modification of GUI for 16-Bit Program | reagent | General Discussion | 7 | 01-12-2005 13:27 |
MD4/MD5/HAVAL-128 has been cracked!! | loveboom | General Discussion | 3 | 08-27-2004 21:19 |