System.Text.Encoding;
rgbKey, rgbIV, bytes, array_: TBytes;
dESCryptoServiceProvider: System.Security.Cryptography.DESCryptoServiceProvider;
cryptoTransform: System.Security.Cryptography.ICryptoTransform;
begin
unicode := System.Text.Encoding.Unicode;
rgbKey := TBytes.Create(1, 2, 3, 4, 5, 6, 7, 8);
rgbIV := TBytes.Create(1, 2, 3, 4, 5, 6, 7, 8);
dESCryptoServiceProvider := System.Security.Cryptography.DESCryptoServiceProvider.Create;
cryptoTransform := dESCryptoServiceProvider.CreateEncryptor(rgbKey, rgbIV);
bytes := unicode.GetBytes(data);
SetLength(array_, Length(bytes));
cryptoTransform.TransformFinalBlock(bytes[0], 0, Length(bytes), array_[0], 0);
Result := System.Convert.ToBase64String(array_);
end;
.
< !- - - - - >