DelphiEncryptionCompendium icon indicating copy to clipboard operation
DelphiEncryptionCompendium copied to clipboard

Twofish issue

Open vpapanik opened this issue 4 years ago • 6 comments

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.

vpapanik avatar May 20 '20 09:05 vpapanik

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

MHumm avatar Jan 06 '21 08:01 MHumm

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;

ATroschke avatar Jul 13 '23 10:07 ATroschke

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.

MHumm avatar Jul 13 '23 10:07 MHumm

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: @.***>

ATroschke avatar Jul 13 '23 10:07 ATroschke

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!

MHumm avatar Jul 13 '23 11:07 MHumm

Sorry for the late reply, I've updated the code snippet and verified that the same issue still occurs.

ATroschke avatar Jul 25 '23 06:07 ATroschke