One of the biggest risks for tech investors is how quickly trends can shift in the industry. That factor makes it unusually hard to determine which businesses can reliably boost earnings for a decade or longer.

However, the cybersecurity niche isn't as impacted by this risk and there's an excellent chance that consumers and enterprises will rely on cybersecurity providers to protect their data well into the future, and likely to a greater extent than they do today.

With that bright industry outlook in mind, let's look at two excellent stock options for investors: Palo Alto Networks (PANW) and Microsoft (MSFT).

Palo Alto Networks

Palo Alto Networks has many of the hallmarks of a successful growth stock. The company is winning market share in a large, growing industry. Sales were up 26% in the most recent quarter, hitting the high end of management's outlook. The sales spike also represented a modest acceleration compared to the prior quarter. "We continue to see our teams execute well in the midst of macroeconomic challenges," CEO Nikesh Arora said in a Feb. 21 press release.

The company is delivering on the bottom line, too. After having closed out a full year of profitability in fiscal 2022, which ended in July 2022, management just raised the earnings outlook for 2023. The company now expects operating profit margin to land between 21.5% of sales and 22% of sales, up from the prior range of 19.5% to 20%.

Palo Alto Networks is also seeing higher cash flow trends and raising those goals, too. These successes are encouraging to see in today's tough operating environment, but they signal even better earnings growth once the next cyclical upswing hits the cybersecurity industry.

Microsoft will get bigger

You might think you missed the boat on Microsoft's stock, given that the stock is up nearly 800% over the past decade and the company has been valued at over $2 trillion within the past year. Yet there's plenty of room for more growth with this diverse tech giant.

Microsoft's cybersecurity offerings are a relatively small, but important part of its tech empire. The security segment recently crossed $20 billion in annual revenue, and a key draw for customers is the ability to partner with just one company for a wide range of their security needs. Microsoft said in a recent earnings call with analysts that one large retailer in Q3 consolidated from 10 vendors to just Microsoft.

With a Microsoft investment, you also gain exposure to several other exciting growth avenues such as video games, AI, and cloud enterprise services. The company also pays a modest dividend (yielding roughly 1.1% at the current stock price) that's likely to expand over time thanks to gushing annual cash flow.

MSFT Cash from Operations (TTM) Chart

MSFT Cash from Operations (TTM) data by YCharts

Yet investors haven't sent either stock much higher in the past year on fears of slowing growth over the short term. Patient investors can look past those challenges toward excellent returns that are measured in years rather than quarters.

You'll likely look back in a decade and be glad you put Microsoft and Palo Alto Networks in your portfolio.