Different encryption in version 3.1

Today I installed version 3.1 of Cryptography Pack. This version returns value of decryption, which differs from previous version. I used older version to encrypt data and store them into database. Older version returned for example 'MY PASS' but the newer one returns for example 'MY PASS'#0. I do not know what other values can be returned and which algorithm is valid: the older one or the new one. Am I doing something wrong? If newer algorithm is valid, how can I re-crypt data in the database into new form?


I use the following function:

function DecodeAES2String (const EncryptedText, Key : string) : string;
var
  aes    : TAESEncryption;
  cipher : string;
  i      : Integer;
  iv     : string;
begin
  Result := '';
  aes := TAESEncryption.Create;
  try
    aes.AType        := atCBC;
    aes.KeyLength    := kl256;
    aes.Unicode      := yesUni;
    aes.Key          := Key;
    aes.OutputFormat := base64;
    aes.PaddingMode  := TpaddingMode.PKCS7;
    iv := '';
    for i := 1 to 16 do
      iv := iv + Chr(0);
    aes.IV  := iv;
    aes.IVMode       := TIVMode.userdefined;
    Result           := aes.Decrypt (EncryptedText);
  finally
    aes.Free;
  end;
end;

Hi,
The only changes are in the Unicode encoding of characters. We noticed in previous version that there was a bug with Chinese characters, because of different Unicode mapping.
Do you have an example of EncryptedText and Key to share with us to test this function?
Best regards,
Marion
Please try for example: 
  Key := '123456UXFTzqkeVAeyRT0tRh9x317gk3';
  TextToEncrypt:= 'MYPASS';

After encryption we have encrypted string: 'TrluYoOMdOQ+/o4sHqiMAg=='
But when we decrypt it, we receive 'MYPASS'#0

Thank you for your example, I have just found how to fix the bug. In
TConvert.StringToByteArray in MiscObj.pas you have to replace
"SetLength(Result, Length(s) + 1);" by "SetLength(Result, Length(s));"
and the final zero will disappear.

We will release a 3.1.0.1 version to fix this bug.
Sorry for the inconvenience,
Marion

No problem, thank you for the quick response.