Or, when you're a quasi-religious dictatorship with strict information control, you just recognize math talent in 1st grade and funnel students into patriotic computer security-specific training.
North Korea has been ruled by the Kims for 74 years at this point.
A few computers aren't expensive for even a low-wealth country, and math is cheap to teach.