National Security Agency head Gen. Keith Alexander told a cybersecurity panel Tuesday that the “media leaks legislation” he proposed to prevent journalists from reporting on government surveillance programs like those leaked by Edward Snowden could be here within weeks.

“We’ve got to handle media leaks first,” Alexander said in a Guardian report. “I think we are going to make headway over the next few weeks on media leaks.”

The general expressed his support for similar actions taken by the United Kingdom last summer when the British government detained Guardian Journalist Glenn Greenwald’s partner David Miranda for nine hours at London’s Heathrow airport on terrorism charges for carrying classified data about UK surveillance programs leaked by Snowden.

Last month, a panel of UK judges defended the British government’s decision, despite acknowledging Miranda had no involvement in terrorism.

“They looked at what happened on Miranda and other things, and they said it’s interesting: journalists have no standing when it comes to national security issues,” Alexander told the panel audience at Georgetown University. “They don’t know how to weigh the fact of what they’re giving out and saying, is it in the nation’s interest to divulge this.”

“And I just put that on the table because that’s a key issue that we as a nation [are] going to face,” Alexander said. “My personal opinion: these leaks have caused grave, significant and irreversible damage to our nation and to our allies. It will take us years to recover.”

According to the general, “media leaks” have been getting in the way of a congressional bill giving NSA and U.S. Cyber Command, which he also heads, the ability to communicate secretly with private organizations about cyber attacks and Internet data collection.

“I am an optimist. I think if we make the right steps on the media leaks legislation, then cyber legislation will be a lot easier,” Alexander said.

The general originally expressed his support for a bill silencing journalists last October in an interview with the Department of Defense’s “Armed with Science Blog,” where he said, “We ought to come up with a way of stopping it. I don’t know how to do that. That’s more of the courts and the policymakers but, from my perspective, it’s wrong to allow this to go on.”

Alexander, who is due to retire in the coming weeks, said he was headed to the White House Tuesday to talked about the changes proposed to the NSA’s bulk data collection of domestic phone records and data.

Follow Giuseppe on Twitter