Few people truly understand what the U.S. National Security Agency actually does. Its former leader cleared that up on Tuesday.

NSA is America's hacker.

"We steal other people's stuff in the cyber domain," retired General Michael Hayden said at a cybersecurity conference in Miami Beach.

He then put that in context: Every country's government is spying on other people and governments. America's spies just do it better.

"As a former director of NSA, I like to think we're number one," he said.

Hayden delivered the keynote address at S4X16 conference, which focuses on how modern hackers are increasingly attacking key industrial controls at power plants, factories, and municipal services like water and gas.

The former intelligence official explained how the United States justifies hacking into computers in foreign countries -- and how it draws the line on when it's OK.

"We steal stuff to keep you free and keep you safe," Hayden said. "We do not steal stuff to make you rich. I can think of only four other countries who can say that. They all speak English."

Hayden referred to the United States' four other partners in the "Five Eyes" group of nations: Australia, Canada, New Zealand, the United Kingdom.

For the rest of the world, corporate espionage is a state mission, he said.

"Every other nation-state believes it is legitimate espionage activity to steal intellectual property," he added. "And the Chinese are the poster child for it."

In international politics, this distinction is a fuzzy line. And it's one of the reasons some governments are uneasy about America's massive spying operations.

The most stark example came in October last year, when the European Union's highest court struck down a lucrative, longstanding data-sharing agreement between the United States and Europe. "Safe Harbor" rules ensured privacy-conscious Europeans that American companies like Facebook and Google were guarding their personal information with "adequate protections."

But the European Court of Justice invalidated Safe Harbor. It's main reason? Ex-NSA contractor Edward Snowden exposed the vast extent of the U.S. electronic surveillance.

In an interview, Hayden insisted that the EU's government is wrong. He said American policy draws a line on when it's OK to hack.

"Do we steal economic information? Of course we do: precursor chemicals, dual-use equipment... money laundering. But we do not do it for commercial advantage."

"We don't have any state owned enterprises," he said. "What would I do with it once I stole it? Who would I give it to? Lockheed Martin (LMT) but not Boeing (BA)? Northrop Grumman (NOC), but not Lockheed? It's almost madness."

The key difference is how a nation defines "national security," Hayden explained.

"Other nations' definition of national security is a broader one than what we allow ourselves," he said. "They view economic success as a national security objective. We don't in terms of state espionage."