Edward Snowden's revelations a year ago that the US National Security Agency (NSA) had hacked major computer networks in Hong Kong and mainland China posed a dilemma for Beijing, Chinese experts have said. How should China handle the affair to its maximum advantage without jeopardising all-important ties with Washington?
For the Ministry of Foreign Affairs, Snowden's revelations came at an awkward time. Just three days before Snowden gave an interview to the South China Morning Post detailing the NSA's spying programmes, President Xi Jinping had met US President Barack Obama at the Sunnylands estate in California. The Chinese side had attached great importance to the meeting and took painstaking efforts to prepare for it. Xi used the summit to put forward his concept of developing a "new type of major power relations" - one that allowed for a more equal, closer partnership with the US. But the Snowden incident immediately put the relationship to the test.
Some people in the US were already set against the idea of developing closer ties with China and were not happy with Obama cosying up to China, and the Snowden incident gave them the chance to come out and say 'You see, I was right,'" said Jia Qingguo , a professor of international relations at Peking University.
Beijing was unlikely to hand Snowden back to the US, given the scale of America's spying programme on China as laid out in his claims. "From China's perspective, it [the leadership] probably did not want to let him go back to the US. Our national security authorities probably wanted to get their hands on him," Jia said. "But China is working with the US on so many levels", and they did not want Snowden's presence in China to undermine bilateral ties, he said.
Even with the complications it brought, the incident offered Beijing advantages. Washington's credibility and moral position, both internationally and domestically, were now seriously undermined. On the issue of cybersecurity negotiations, for instance, China had suddenly gained greater leverage.
"In the past, cybersecurity talks [between China and the US] were a one-way thing - the US always made accusations about China's cyberattacks and internet thefts in a condescending tone," said Richard Hu Weixing, director of the University of Hong Kong's department of politics and public administration.
"But now the cybersecurity dialogue has expanded a lot and the US has lost its moral high ground, as the world now sees it as the most intrusive country on the internet."
Washington's weakened position was evident last month, Hu said, when the Justice Department announced the prosecution of five Chinese military officers on hacking charges. "As you could see, no one clapped their hands," Hu said.
Adding to the complexity of the situation was the fact Snowden chose to come to Hong Kong, a part of China but under a unique set of political arrangements that give the city a high level of autonomy. It has its own legal system, and holds different extradition treaties with foreign countries. While the US and Hong Kong have an agreement for the exchange of suspects, no such pact exists between Washington and Beijing.
Washington could, and did, ask Hong Kong to hand Snowden back. But the city government's choice of actions was constrained. There was wide sympathy for Snowden in Hong Kong, with several demonstrations staged in support of the American following the Post report. At one point, Snowden said he would stay in the city and allow his fate to be decided there.
"My intention is to ask the courts and people of Hong Kong to decide my fate. I have been given no reason to doubt your system," he told the Post.
Whatever decision Beijing made would have to take Hong Kong's unique position into consideration. None of the insiders contacted by the Post would detail Beijing's role in Snowden's eventual move to Russia.
But Jia said the outcome was "a lesser evil", although not all in Washington perhaps saw it that way. "Months after the incident I asked a US official who was visited Beijing whether the Snowdon incident was over," Jia said. "He said 'no, we still remember that'".
The "Snowden effect" in China also lives on. Professor Jiang Tianfa , who teaches cybersecurity at the South-Central University for Nationalities in Wuhan , said Snowden single-handedly drove up attendance at his lectures on cyberwarfare.
"Many wanted to learn how to 'hack like Snowden', Jiang said with a chuckle. "Edward Snowden is their idol. Without him, the interest and awareness about information security would never have been so high. Even those who are not interested in becoming a hacker want to know how to protect themselves and avoid becoming a victim."
The impact was felt on a broader national level. Immediately after the Post report, national security authorities put internet security under greater scrutiny, according to Jiang, who is a member of The China Computer Federation Database Technical Committee - a body the government regularly consults on information security issues.
Jiang said the authorities had identified several weak links in their communication protocols. Financial institutions were also told to carry out extensive software and hardware upgrades.
Jiang said the most fundamental change in China took place in the public mindset, which was "more important than technological upgrades".
"With the new knowledge, there is a strong demand for government actions," he said. "The government used the public sentiment to its advantage to replace foreign products with domestic ones."
Soon after the Snowden incident, Chinese telecommunication companies such as China Unicom began to replace a number of critical routers made by Cisco with domestic products to increase the security level of China's backbone internet infrastructure.
Professor Gu Dawu , an internet security researcher with Shanghai Jiao Tong University and an adviser to the central government on cybersecurity technology, agreed the impact of the Snowden affair was significant. But Beijing had yet to make any significant move to keep overseas technology out of the mainland.
"The impact of Snowden is enormous on Chinese society and there were lots of proposals on switching to domestic products," Gu said. "But I have not seen or heard about any big actions."
Nevertheless, the business of some US companies in China dropped in the aftermath.
Cisco, whose products Snowden said the NSA had bugged in China, reported an 18 per cent decline in orders from China in the last quarter of last year. IBM reported a 40 per cent drop in hardware revenues from China in the same period.