DelphiEncryptionCompendium
DelphiEncryptionCompendium copied to clipboard
Change IV
The literature describes that the initial vector (IV) should not be constant. I have therefore changed the code so that the IV is also changed each time the key is changed. I realized this with the help of a hash of the key in truncated length (12). Then I set OnChange and OnTyping of the editKey. I hope that I have communicated this correctly.
procedure TFormMain.EditInitVectorChange(Sender: TObject); var InitV : string; //vom Key wird ein Hash genutzt, um den InitVector zu bestimmen (OnChange und OnTyping von editKey setzen) begin InitV := THashSHA2.GetHashString(EditKey.Text, THashSHA2.TSHA2Version.SHA224).ToLower; EditInitVector.text:=Copy (InitV,0,12); end;