The cybersecurity industry is growing fast, and Palo Alto Networks (PANW -1.71%) and Fortinet (FTNT -2.17%) have been two of its top performers recently. Over the last 12 months, shares of Palo Alto and Fortinet are up 57% and 70%, respectively. Given that businesses' digital security needs are on the rise, it's understandable that investors would want in, but which of these high-flying stocks you prefer will depend on your penchant for risk.

A tale of two cybersecurity firms

Both Palo Alto and Fortinet provide a full suite of security services for enterprise, mobile, and cloud computing networks. Sales have been strong as cyberattacks increase in frequency and complexity. Over the last five years, Fortinet's revenue is up over 160% and has topped $1.5 billion in the last 12 months, and Palo Alto Networks' increased 400% to surpass $2 billion. That makes them two of the largest cybersecurity pure plays out there.

Palo Alto Networks 

Q3 Fiscal 2018*

Q3 Fiscal  2017

Year-Over-Year % Increase

Revenue

$567.1 million

$431.8 million

31%

Operating income (loss)

($51.6 million)

($49.1 million)

N/A

Earnings per share

($0.51)

($0.67)

N/A

Adjusted earnings per share

$0.99

$0.61

62%

*Quarter ending April 30, 2018. Data source: Palo Alto Networks.

Fortinet 

Q1 2018

Q1 2017

Year-Over-Year % Increase

Revenue

$399.0 million

$340.6 million

17%

Operating income

$32.4 million

$5.4 million

500%

Earnings per share

$0.24

$0.06

300%

Adjusted earnings (loss) per share

$0.33

$0.17

94%

Data source: Fortinet.

Palo Alto won the top-line growth contest by dumping more money into sales and marketing, as well as a couple of big cloud-based security acquisitions, while Fortinet made just one small acquisition in the last year. Dropping below the revenue line item, though, reveals where the real divergence lies.

Two very different stocks

Fortinet is by far the more conservative company financially; Palo Alto, in contrast, is sacrificing profitability now to maximize revenues. One of the big reasons Palo Alto operates at a loss is the amount of stock-based employee compensation it distributes. Excluding that, the company is in the black, but it's worth noting as it also dilutes the ownership of current shareholders. In the most recent quarter, Palo Alto shelled out $123.1 million in share-based compensation. But as long as sales continue to grow at a strong double-digit percentage rate, the security outfit can get away with that. 

A woman sitting in front of a laptop with a worried look on her face.

Image source: Getty Images.

Fortinet, on the other hand, is moving in the opposite direction. Its earnings per share got a big boost from the company's stock buyback program. In its last quarter, it repurchased $115.5 million worth of stock, and as of March 31, had 3.6% fewer shares outstanding than  a year earlier. Fortinet also carries zero debt, whereas Palo Alto has $543.8 million worth of convertible notes in the liabilities section of its books. That's not necessarily a lot, but it demonstrates how much more aggressive a strategy it's pursuing than its peer.

So which stock is the right one for you? After Fortinet shares' 70% advance over the last year, they actually hold the higher valuation, despite the company's slower revenue growth. Its price-to-free-cash-flow ratio is at 23.9 compared to 22.0 for Palo Alto Networks. If current trends continue, that could mean Palo Alto has more upside in the near term. However, given its more aggressive pursuit of sales, its stock will likely manifest more ups and downs over time than Fortinet's will.

With the cybersecurity industry experiencing strong demand growth, both companies should do well. However, for those who'd prefer a less bumpy ride, I think Fortinet is the ticket.