A month before the election, President Donald Trump stood before a cheering crowd at a rally in northeast Pennsylvania and declared: "I love WikiLeaks!"

Back then, Trump loved anything that made his rival Hillary Clinton look bad - even if the information had been hacked, stolen or leaked.

Trump repeatedly celebrated and shared information released by WikiLeaks, calling the anti-secrecy organisation "a treasure trove".

During a press conference last northern summer, Trump even urged Russia - which US intelligence agencies believe has links to WikiLeaks - to look for tens of thousands of emails from Clinton's private server that were not handed over to the Justice Department.


But now that he's in the White House, Trump is having to confront the threat of hacking, along with leaks from within his own Administration - and, suddenly, he's not a fan.

Trump and his aides have angrily railed against leakers, threatening to find and prosecute them and urging congressional allies to investigate, while being uncharacteristically quiet when it comes to WikiLeaks.

The latest sign of how the tables have turned came today when WikiLeaks announced that it had obtained a vast portion of the Central Intelligence Agency's closely guarded cyberweapons and began posting files online.

The breach could cause massive fallout among US allies and poses a serious challenge for Trump, who has been feuding with the intelligence community over probes into alleged ties between his campaign and Russia.

White House Press Secretary Sean Spicer declined to comment on the latest WikiLeaks dump during a briefing with reporters, saying it "has not been fully evaluated". But moments later, Spicer did decry leaks generally, saying they "are threatening our national security".

"You're seeing the leaks happen over and over again that come out throughout the Administration, throughout government and undermine national security," he said.

While the files being posted by WikiLeaks have yet to be authenticated, Senator John McCain said that if the group "can hack the CIA, they can hack anybody". McCain also mocked Trump for belittling earlier hacks by suggesting that they were being carried out by "somebody in the basement of his mother's house smoking a cigarette in his underwear" rather than a foreign government. McCain said the White House needs to focus on the issue quickly.

"I'd like to see a greater emphasis, to tell you the truth," McCain said. "I really would. I'd like to see a greater emphasis."

For months, a variety of people have warned Trump that hacking is something that should always be condemned and never encouraged - even in a joking tone.

Last July, WikiLeaks published thousands of emails from Democratic National Committee. Days later, Trump scoffed at accusations that the Russians could have been involved with the hack, saying that it was "probably China, or it could be somebody sitting in his bed." He added that he hoped Russia had all of Clinton's emails, even the "beauties" that were deleted or were not turned over to the Justice Department.

"I will tell you this, 'Russia, if you're listening, I hope you're able to find the 30,000 emails that are missing,'" Trump said, referring to messages that Clinton did not hand over because she and her team categorised them as personal. "I think you will probably be rewarded mightily by our press. Let's see if that happens."

Republicans rushed to denounce the comment, and Trump's running mate Mike Pence quickly issued a statement that read: "If it is Russia and they are interfering in our elections, I can assure you both parties and the United States Government will ensure there are serious consequences."

Months later in October, the private email account of Clinton's presidential campaign chairman, John Podesta, was hacked and his emails were released by WikiLeaks. At the time, Podesta said the FBI was investigating the "criminal hack" as part of a wider inquiry into potential Russian cyberattacks - and he suggested Trump might have known about the hack ahead of time.

Trump and his associates have denied having anything to do with the hacks, although at a January 11 press conference, Trump conceded that Russia was likely behind the hacks. He added that the Russians might have tried to hack the Republican National Committee but were unable to because it had "a very, very strong hacking defence".

"The Democratic National Committee was totally open to be hacked. They did a very poor job. They could have had hacking defence, which we had," Trump said. ". . .They tried to hack the Republican National Committee, and they were unable to break through. We have to do that for our country. It's very important."

Jennifer Palmieri, the communications director for Clinton's 2016 campaign, said watching Trump decry leaks within his own administration after praising WikiLeaks during the campaign has been an exercise in the absurd. Now, she said, Trump may be forced to confront the consequences of normalising a culture of leaks and hacks.

"He was playing with fire all during the campaign and he's started to get burned," she said. "When you bring leaks and investigations into the political realm, you're playing with fire."

Robby Mook, Clinton's former campaign manager, said he hopes Trump finally realises that the hacking that happened during the election is "an anti-American problem," not a partisan one, and needs to be investigated so it doesn't become a regular part of the political process.