Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change IV #75

Open
EdAdvokat opened this issue May 9, 2024 · 2 comments
Open

Change IV #75

EdAdvokat opened this issue May 9, 2024 · 2 comments
Assignees

Comments

@EdAdvokat
Copy link

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;

@MHumm
Copy link
Owner

MHumm commented May 9, 2024

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?

@EdAdvokat
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants