Government needs some degree of secrecy to preserve a free and open society. But government can abuse secrecy. That abuse threatens the long-term viability of the same free and open society.

That paradox comes to mind when listening to Andrew McCarthy. A senior fellow at the National Review Institute, McCarthy once worked as a high-profile federal prosecutor. He led the team that put “blind sheik” Omar Abdel Rahman behind bars in connection with the 1993 World Trade Center bombing.

McCarthy has focused attention recently on federal investigations involving Hillary Clinton and Donald Trump, the major combatants in the 2016 American presidential election. McCarthy labeled the contrasting investigations “very important and very frustrating” during a Wednesday, Feb. 7, speech in Charlotte.

“Here we are talking about the essence of the things that we really need government to do,” McCarthy told an audience of NRI and John Locke Foundation supporters. “To the extent that we have to give limited authority, it really is in the domain of national security and also governance. It’s about whether the federal government works in the way it’s designed to work. And what we have had from early in 2016 forward, is a situation where those two things are severely challenged.”

“Can we trust the government to give everyone equal protection under the law, and can we trust the government to use its foreign intelligence collection authorities — which are there for the purpose of protecting the United States— can we trust the government to use them properly, as opposed to exploit them to do things like spy for political reasons?”

Secretive law enforcement work extends beyond national security, McCarthy admits. But in most other cases, authorities eventually reveal any secret action when a criminal case heads to trial. That means law enforcement agents and prosecutors must take steps that will stand up to scrutiny from opposing lawyers.

Those lawyers will work as hard as possible “to take the government’s case apart.” This constitutes “the greatest thing about our system,” McCarthy said. “It’s the envy of the world, and it should be.”

In national security cases, by contrast, secret actions often remain secret. We don’t want the bad guys to learn our sources’ names. We don’t want bad actors to learn methods we use to collect information about them.

“The big problem with this — and it is an unavoidable problem; there is no way that you could structure something that could fix this — and that is they have to be able to look you in the eye and say, ‘Trust us,’” McCarthy said.

“We always have to tread carefully in this thicket because we don’t want to inadvertently or otherwise compromise the things that we need to protect the country,” he added. “But at the same time, we have to be aware of the fact that this is an area that the government can very conveniently use to cover up things that it doesn’t want the public to know. And unlike the criminal justice system, it’s not a process where there’s eventually going to be sunlight and we get to look at their work.”

That’s a key reason why the contrast between recent security-related investigations targeting Clinton and Trump proves frustrating.

“Objectively, any person who looks at the way these two things were handled has to say that Mrs. Clinton got the ‘kid-gloves’ treatment and the Mueller investigation and its predecessor Russian investigation — they’re sort of scorching the earth to make a case,” McCarthy said in a one-on-one conversation just before his speech.

“In the Mueller investigation, what we see is that if you lie to the FBI, you actually get prosecuted, which is the way it works in 99.9 percent of cases that don’t involve Clintons,” he added. “In the Clinton investigation, if you lied to the FBI … basically, what they did was whenever anybody got close to providing incriminating information, they either gave them immunity, or they cut a deal with them. They prevented agents from asking key, obvious questions.”

“I think the whole thing, the more we look at it, appears to be a situation where what they essentially did was try to stage something that looked like a thoroughgoing investigation at the end of the rainbow of which she was going to be exonerated, which was politically very important,” he concluded.

This double standard should concern Americans, McCarthy said, “because we want everybody to have the same standard of justice. The rule of law and the reason that we can have ordered liberty in this society is because we believe that the results that come out of the criminal justice system have integrity.”

Future American security depends on restoring that sense of integrity. “We have to be able to trust them because they’re not just out there trying to make cases,” McCarthy said. “They’re trying to protect the country from people who are trying to do harm to America. So it’s important that we have some transparency, and it’s important that we get our agencies to a point where most Americans — when they say ‘Trust us’ — they think they’re worth trusting.”

Without that trust, Americans are less likely to support the degree of secrecy government needs. Secrecy undergirds national security work. Impair that critical work, and we risk endangering the long-term prospects for our free and open society.

Mitch Kokai is senior political analyst for the John Locke Foundation.