BUENOS AIRES — Want to learn how to break into the computerized heart of a medical device or an electronic voting machine? Maybe a smartphone or even a car? Thanks to the legacy of military rule and a culture of breaking rules of all sorts, Argentina has become one of the best places on earth to find people who could show you how.

As Silicon Valley’s talent war has gone global, particularly for those skilled at breaking into things, this Latin American nation has become a rich recruiting ground for corporations and foreign governments. Companies need hackers to help defend against online criminals and state-sponsored spies. And as the world’s critical infrastructure moves online and the threat of war moves into cyberspace, governments are desperate to acquire hackers’ tools.

“Cheating the system is part of the Argentine mentality,” said Cesar Cerrudo, an Argentine security researcher who taught himself to hack as a young teenager living in Paraná, a small town in the northeastern part of the country. Mr. Cerrudo recently gained attention for successfully hacking into traffic light systems in cities across the United States.

“Unless you are rich, you grow up without a computer or reading books. To access new software, you have to hack it, and you have to teach yourself everything from the ground up,” he said.