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

Passphrase doesn't work with TLbRijndael #25

Closed
78Mahdi opened this issue Oct 31, 2022 · 2 comments
Closed

Passphrase doesn't work with TLbRijndael #25

78Mahdi opened this issue Oct 31, 2022 · 2 comments

Comments

@78Mahdi
Copy link

78Mahdi commented Oct 31, 2022

Hello

I found issue with TLbRijndael, the passphrase has no effect, but it works with TLbBlowfish, i would add the following sample

`procedure TForm1.Button1Click(Sender: TObject);
var
ALbRijndael: TLbRijndael;
begin
ALbRijndael := TLbRijndael.Create(nil);
try
ALbRijndael.GenerateKey('aaa');
ALbRijndael.Encoding := TEncoding.UTF8;
Memo2.Text := ALbRijndael.EncryptString(Memo1.Text);
finally
ALbRijndael.Free;
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
ALbRijndael: TLbRijndael;
begin
ALbRijndael := TLbRijndael.Create(nil);
try
ALbRijndael.GenerateKey('bbb');
ALbRijndael.Encoding := TEncoding.UTF8;
Memo3.Text := ALbRijndael.DecryptString(Memo2.Text);
finally
ALbRijndael.Free;
end;
end;`

@romankassebaum
Copy link
Contributor

I'm really not a LockBox specialist, but from what I have seen you have to set the KeySize first to ks128, ks192 or ks256. Then you can generate a key with the matching length.

@78Mahdi
Copy link
Author

78Mahdi commented Nov 1, 2022

I'm really not a LockBox specialist, but from what I have seen you have to set the KeySize first to ks128, ks192 or ks256. Then you can generate a key with the matching length.

That's correct, thank you for response

@78Mahdi 78Mahdi closed this as completed Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants