You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
The text was updated successfully, but these errors were encountered:
I'm not 100% sure yet what you want me to tell with this. Yes, IV shoudl always be anew one, that's something the samples don't really describe/convey yet. But what do you want me to tell with the code above? Is this a proposed modification of one of the samples?
I thought that every time the key input is changed, the IV also changes automatically.
the IV also changes automatically.
This was meant as a suggestion for Cipher_FMX.
Yes, you can also assume that the demo has no entry for the key and the IV and therefore
the user has to enter the key and IV himself.
However, if he then continues to work and only redefines the key, the IV always remains the same and
that should not be the case.
That was the idea behind my proposed change.
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;
The text was updated successfully, but these errors were encountered: