DelphiEncryptionCompendium
DelphiEncryptionCompendium copied to clipboard
Twofish issue
My program work flawlessly, however when I change the cipher algorithm to Twofish I get an Integer overflow... Can't possibly figure out what may cause this issue.
Where do you get that overflow? Which compiler do you use Delphi or FPC? Did you also try the new V6.0 DEC release found here? https://github.com/MHumm/DelphiEncryptionCompendium
Have the same issue using this on Delphi 11.3.
Can reproduce it easily using the current decfpc/DEC, making a new project and using Twofish.
function EncodeStringTwoFish(const s: string): string;
var
F: TCipher_Twofish;
begin
F := TCipher_Twofish.Create;
try
F.Init('Hello world'); // <-- This is where the Exception occurs
Result := string(F.EncodeBinary(RawByteString(s), TFormat_HEXL));
finally
F.Free;
end;
end;
Unfortunately your code is incomplete: I cannot see how TWO_FISH_KEY is defined and/or initialized. I'm not aware of any issues in TwoFish at the moment, as I'm using that one myself in some places! I do believe you get a crash, but the information provided is not complete enough yet.
It can be anything, for example 'Hello world'. I did not want to compromise our (in production use) crypt key.
Markus @.***> schrieb am Do., 13. Juli 2023, 12:05:
Unfortunately your code is incomplete: I cannot see how TWO_FISH_KEY is defined and/or initialized. I'm not aware of any issues in TwoFish at the moment, as I'm using that one myself in some places! I do believe you get a crash, but the information provided is not complete enough yet.
— Reply to this email directly, view it on GitHub https://github.com/decfpc/DelphiEncryptionCompendium/issues/4#issuecomment-1633947167, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWBKS52HVWOXCEATV2A5FOLXP7B6VANCNFSM4NFYFVRQ . You are receiving this because you commented.Message ID: @.***>
Ok, I can understand that you do not want to compromise a really used key ;-) But if you can reproduce with another one and could add that and the declaration to the code I'd be grateful!
Sorry for the late reply, I've updated the code snippet and verified that the same issue still occurs.