I am trying to encrypt a string but often only part of the string is being encrypted. I don't see anyone else having this problem so I am probably doing something wrong. I have the same problem in Delphi 2007 and 2009. I am using Win XP SP3. Here is the code:
procedure TForm1.Button1Click(Sender: TObject);
var
sTestToConvert: ansistring;
sPassword: ansistring;
begin
sTestToConvert := trim(Memo1.Text);
sPassword := trim(Edit1.Text);
madCrypt.Encrypt(sTestToConvert, sPassword);
Memo2.Text := sTestToConvert;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
sTextToConvert: ansistring;
sPassword: ansistring;
begin
sPassword := trim(Edit1.Text);
sTextToConvert := trim(memo2.Text);
madCrypt.Decrypt(sTextToConvert, sPassword);
Memo1.Text := sTextToConvert;
end;
I also have the same problem when trying to use OldEncrypt and OldDecrypt. Any ideas on what is causing the problem? Thanks.