私は暗号化/復号化ルーチンの初心者です。DCPCrypt を使用して暗号化された文字列を復号化するために、アプリを移行したい Lockbox3 を使用しようとしています。暗号化するこの機能があるとしましょう:
function TfrmMain.Encrypt(value: string): string;
var
  CipherR : TDCP_rijndael;
  m, sm, Key, IV: string;
  Data: string;
begin
  Key := PadWithZeros(m, KeySize);
  IV := PadWithZeros(sm, BlockSize);
  Data := PadWithZeros(value, BlockSize);
  m := 'SOMEWORDSOMEWORD';
  sm := 'WORDSOMEWORDSOME';
  Key := PadWithZeros(m, KeySize);
  IV := PadWithZeros(sm, BlockSize);
  CipherR := TDCP_rijndael.Create(Self);
  if Length(m) <= 16 then
    CipherR.Init(Key[1], 128, @IV[1])
  else if Length(m) <= 24 then
    CipherR.Init(Key[1], 192, @IV[1])
  else
    CipherR.Init(Key[1], 256, @IV[1]);
  CipherR.EncryptCBC(Data[1], Data[1], Length(Data));
  CipherR.Free;
  FillChar(Key[1], Length(Key), 0);
  code := Base64EncodeStr(Data);
  Result := code;
end;
Lockbox3 を使用して、この方法で暗号化された文字列を復号化したいのですが、m および sm として暗号化関数で使用される値を使用する必要があります。sm 値を使用して Codec1.Password を設定しようと考えましたが、これは機能しません。
何か案が?アドバイスをありがとうございました。