People always want to cast Edward Snowden as a hero or as a villain, but Rand Paul says he has "mixed feelings."

"We wouldn't know what our government has done without Edward Snowden," he said on stage at the Yahoo Digital Democracy conference in Des Moines, Iowa, today.

At the same time, he said, "There are secrets the government does have to have," and because Snowden divulged a whole lot of those secrets, the Kentucky senator and presidential hopeful said Snowden should have to face some sort of penalty if and when he returns to the United States.

'All the people who want to chop his head off and shoot him and hang him, I think that’s a bit excessive.' Sen. Rand Paul

Paul was quick to add, though, that the punishment ought to be be proportionate to the penalties faced by sitting government leaders like James Clapper, the national director of intelligence who told a Senate hearing in 2013 that the US was not collecting Americans' data—when, in fact, the National Security Administration was doing just that. Clapper has since defended himself, saying that he misspoke. But he hasn't convinced Paul, an ardent anti-surveillance advocate, who suggested on stage, as he has in the past, that Clapper and Snowden "could share a cell together."

But while Paul believes there should be consequences for people like Snowden, he also believes there should be protections. Specifically, he wants to expand whistleblower laws so that they protect contractors like Snowden, who has claimed that he had "no proper channels" to report the NSA's activity because he wasn't a full-time government employee.

Paul is one of the few Republican candidates to take such an empathetic approach to Snowden. Both Marco Rubio and Chris Christie have called Snowden a "traitor." Jeb Bush said he'd offer Snowden "no leniency." Donald Trump went so far as to say that the US should do to Snowden "what we used to do to traitors"—which is to say, execute him.

"All the people who want to chop his head off and shoot him and hang him," Senator Paul said on stage, "I think that’s a bit excessive."

Paul also reiterated his support of thorough encryption and his opposition to government attempts to convince companies like Apple and Google to create backdoors in their technology for governments, a position he defended during the first Republican debate. Paul said he's not opposed to surveillance altogether, just warrantless surveillance.

Paul is no doubt the one Republican candidate who's best aligned with major tech companies in their stance on surveillance. But he also voiced other views that resonated with Silicon Valley sentiments. Paul expressed a reluctance to regulate companies like Uber or creating a government safety net for drivers and other on-demand employees. Meanwhile, he celebrated the rise of social media and its ability to raise the profile of fringe ideas like, well, many of his.

"I think it's an amazing marketplace," he said. "For people who think outside the box, people who have Libertarian ideas, the Internet has been a great equalizing force."