Cybercrime and cybersecurity had a record year in 2021, with the Theft Research Center saying the number of data breaches recorded surpassed the previous record year by 23%. As 5G networks increase the number of devices accessing the Internet of Things, the threat hackers pose is only going to get worse.

Cybersecurity stocks should be seen as one of the prime opportunities for investors, because like death and taxes, cybercrime will likely always be with us. For that reason, this pair of companies should be at the top of every investor's list of cybersecurity stocks to own for decades to come.

Padlock and chains across computer keyboard.

Image source: Getty Images.

1. CrowdStrike

CrowdStrike (CRWD -1.82%) is a leading player in the field with its Falcon platform deploying sophisticated machine learning, artificial intelligence, and behavioral analysis to detect and thwart cybersecurity risks.

The platform manages trillions of events every week and as time progresses, it is able to recognize and respond to potential threats more quickly while also allowing customers to customize and personalize solutions in a cost-effective manner. In just five years CrowdStrike's subscriber count has catapulted from 450 to more than 16,325, and annual recurring revenue (ARR) is accelerating.

Ending ARR in CrowdStrike's fourth quarter grew 65% year over year to over $1.7 billion, while subscription customers who have signed up four, five, or six or more modules increased to 69%, 57%, and 34%, respectively, in the period. The more modules customers adopt, the more enmeshed the CrowdStrike ecosystem becomes. Dollar-based net retention rate, or the ARR of existing clients compared to the ARR from the same customers a year ago, was nearly 124% this quarter, and it has become adept at landing large, enterprise-level customers buying more modules.

CrowdStrike's strike, which had lost nearly half its value after the market began rotating out of previous high-flying tech stocks into more defensive consumer-oriented ones, began rising again after the earnings report has now added 50% to its price, though it remains some 25% below where it was last November.

The cybersecurity specialist is generating significant free cash flow, delivering record amounts for the second consecutive quarter. All this makes its stock a smart choice for the buy-and-hold portion of your portfolio.

Glowing computer chip.

Image source: Getty Images.

2. Nvidia

Nvidia (NVDA -3.87%)? Yes, Nvidia. Although obviously best known as the premier developer of computer graphics processing units (GPUs) for gaming, which remains its biggest moneymaker, Nvidia is actually deeply involved in cybersecurity through its Morpheus platform that it points out is an open application framework enabling developers to "create optimized AI pipelines for filtering, processing, and classifying large volumes of real-time data." 

Morpheus offers dynamic protection, real-time telemetry, and adaptive defenses while offering complete visibility into security threats. This makes sense really, since the processing power needed to perform intensive gaming graphics is well suited to gathering real-time network data and assessing the potential threats as it moves through the pipeline. Nvidia is perfectly suited for the job.

Further, because Morpheus is extensible, developers who have already invested in certain models can still deploy them using Nvidia's framework and build on their existing work.

Obviously Nvidia isn't a pure play in cybersecurity the way CrowdStrike is, but as the level of cybercrime increases, it should become an important component of the chipmaker's overall business. Look at its stock as a cybersecurity play with a massive dollop of gaming and data center growth thrown in.

Wall Street forecasts Nvidia will be growing profits at a compounded rate of 30% annually for the next five years, but investors can be assured that cybersecurity, gaming, and data centers will be growth markets for decades.