title: Delphi (FMX): DCPCrypt2 in Windows produces different result in Android/IOS
body: <p>I am trying to write a function that returns the same result in Delphi (RAD Studio 10.2) as the following piece of code in PHP: </p>
  
  <pre><code>&lt;?php
    $method = 'AES-256-CTR';
    $data = 'Hello, world!';
    $key = 'bRuD5WYw5wd0rdHR9yLlM6wt2vteuini';
    $vector = 'bf49ea9d61104d8c'; 
    $crypt = openssl_encrypt($data, $method, $key, 0, $vector);
    echo $crypt;
  ?&gt;
  </code></pre>
  
  <p>I have come up with this function in Pascal (using the DCPcrypt v2.1 library written by David Barton):</p>
  
  <pre><code>procedure TMainForm.Encrypt1ButtonClick(Sender: TObject);
  var
    Cipher: TDCP_rijndael;
    Key, Vector: RawByteString;
    Data, Crypt: RawByteString;
  begin
    Data := 'Hello, world!';                    
    SetLength(Crypt, Length(Data));
    Key := 'bRuD5WYw5wd0rdHR9yLlM6wt2vteuini';  
    Vector := 'bf49ea9d61104d8c';               
    Cipher := TDCP_rijndael.Create(nil);
    try
      Cipher.Init(Key[1], 256, @Vector[1]);
      Cipher.EncryptCTR(Data[1], Crypt[1], Length(Data));
    finally
      Cipher.Free;
    end;
    EncryptEdit.Text := DCPBase64.Base64EncodeStr(Crypt);
  end;
  </code></pre>
  
  <p>And indeed this works (in Windows). Both PHP and Pascal return: <code>pEP16OOxov9QDfraIg==</code></p>
  
  <p>However, if I compile the same code for Android and run it on my tablet, I get a very different result. Why is that?</p>
  
  <p>I did read the documentation about converting code for fmx, specifically the stuff that deals with string handling, but I still don't understand why. Even if RawByteString would be 0-based instead of 1-based, I still get a difference (tried with [0] instead of [1]). A RawByteString does not have a codepage attached, right? So the problem can't be caused by some string conversion (I think). So what is going on here?</p>