private byte[] ProcessInput(bool forEncrypting, string input, bool hexInput = false) { var inBytes = hexInput ? Utility.ConvertHexToBytes(input) : Utility.ConvertToBytes(input); var buffer = new byte[inBytes.Length]; cipher.Init(forEncrypting, cipherParams); cipher.ProcessBytes(inBytes, 0, inBytes.Length, buffer, 0); cipher.Reset(); return(buffer); }