Affichage des articles dont le libellé est Github. Afficher tous les articles
Affichage des articles dont le libellé est Github. Afficher tous les articles

vendredi 29 juin 2018

The great firewall of China: Xi Jinping’s internet shutdown

Before Xi Jinping, the internet was becoming a more vibrant political space for Chinese citizens. But today the country has the largest and most sophisticated online censorship operation in the world.  
By Elizabeth C Economy

In December 2015, thousands of tech entrepreneurs and analysts, along with a few international heads of state, gathered in Wuzhen, in southern China, for the country’s second World Internet Conference. 
At the opening ceremony Chinese dictator Xi Jinping set out his vision for the future of China’s internet. 
“We should respect the right of individual countries to independently choose their own path of cyber-development,” said Xi, warning against foreign interference “in other countries’ internal affairs”.
No one was surprised by what they heard. 
Xi had already established that the Chinese internet would be a world unto itself, with its content closely monitored and managed by the Communist party. 
In recent years, the Chinese leadership has devoted more and more resources to controlling content online. 
Government policies have contributed to a dramatic fall in the number of postings on the Chinese blogging platform Sina Weibo (similar to Twitter), and have silenced many of China’s most important voices advocating reform and opening up the internet.
It wasn’t always like this. 
In the years before Xi became president in 2012, the internet had begun to afford the Chinese people an unprecedented level of transparency and power to communicate. 
Popular bloggers, some of whom advocated bold social and political reforms, commanded tens of millions of followers. 
Chinese citizens used virtual private networks (VPNs) to access blocked websites. 
Citizens banded together online to hold authorities accountable for their actions, through virtual petitions and organising physical protests. 
In 2010, a survey of 300 Chinese officials revealed that 70% were anxious about whether mistakes or details about their private life might be leaked online. 
Of the almost 6,000 Chinese citizens also surveyed, 88% believed it was good for officials to feel this anxiety.
For Xi Jinping, however, there is no distinction between the virtual world and the real world: both should reflect the same political values, ideals, and standards. 
To this end, the government has invested in technological upgrades to monitor and censor content. 
It has passed new laws on acceptable content, and aggressively punished those who defy the new restrictions. 
Under Xi, foreign content providers have found their access to China shrinking. 
They are being pushed out by both Xi’s ideological war and his desire that Chinese companies dominate the country’s rapidly growing online economy.
At home, Xi paints the west’s version of the internet, which prioritises freedom of information flow, as anathema to the values of the Chinese government. 
Abroad, he asserts China’s sovereign right to determine what constitutes harmful content. 
Rather than acknowledging that efforts to control the internet are a source of embarrassment – a sign of potential authoritarian fragility – Xi is trying to turn his vision of a “Chinanet” (to use blogger Michael Anti’s phrase) into a model for other countries.
The challenge for China’s leadership is to maintain what it perceives as the benefits of the internet – advancing commerce and innovation – without letting technology accelerate political change. 
To maintain his “Chinanet”, Xi seems willing to accept the costs in terms of economic development, creative expression, government credibility, and the development of civil society. 
But the internet continues to serve as a powerful tool for citizens seeking to advance social change and human rights. 
The game of cat-and-mouse continues, and there are many more mice than cats.
The very first email in China was sent in September 1987 – 16 years after Ray Tomlinson sent the first email in the US. 
It broadcast a triumphal message: “Across the Great Wall we can reach every corner in the world.” 
For the first few years, the government reserved the internet for academics and officials. 
Then, in 1995, it was opened to the general public. 
In 1996, although only about 150,000 Chinese people were connected to the internet, the government deemed it the “Year of the Internet”, and internet clubs and cafes appeared all over China’s largest cities.
Yet as enthusiastically as the government proclaimed its support for the internet, it also took steps to control it. 
Rogier Creemers, a China expert at Oxford University, has noted that “As the internet became a publicly accessible information and communication platform, there was no debate about whether it should fall under government supervision – only about how such control would be implemented in practice.” 
By 1997, Beijing had enacted its first laws criminalising online postings that it believed were designed to hurt national security or the interests of the state.
China’s leaders were right to be worried. 
Their citizens quickly realised the political potential inherent in the internet. 
In 1998, a 30-year-old software engineer called Lin Hai forwarded 30,000 Chinese email addresses to a US-based pro-democracy magazine. 
Lin was arrested, tried and ultimately sent to prison in the country’s first known trial for a political violation committed completely online. 
The following year, the spiritual organisation Falun Gong used email and mobile phones to organise a silent demonstration of more than 10,000 followers around the Communist party’s central compound, Zhongnanhai, to protest their inability to practise freely. 
The gathering, which had been arranged without the knowledge of the government, precipitated an ongoing persecution of Falun Gong practitioners and a new determination to exercise control over the internet.
The man who emerged to lead the government’s technological efforts was Fang Binxing. 
In the late 1990s, Fang worked on developing the “Golden Shield” – transformative software that enabled the government to inspect any data being received or sent, and to block destination IP addresses and domain names. 
His work was rewarded by a swift political rise. 
By the 2000s, he had earned the moniker “Father of the Great Firewall” and, eventually, the enmity of hundreds of thousands of Chinese web users.
Throughout the early 2000s, the Chinese leadership supplemented Fang’s technology with a set of new regulations designed to ensure that anyone with access to China’s internet played by Chinese rules. 
In September 2000, the state council issued order no 292, which required internet service providers to ensure that the information sent out on their services adhered to the law, and that some domain names and IP addresses were recorded. 
Two years later, Beijing blocked Google for the first time. (A few years later, Google introduced Google.cn, a censored version of the site.) 
In 2002, the government increased its emphasis on self-censorship with the Public Pledge on Self-Discipline for China’s Internet Industry, which established four principles: patriotic observance of law, equitableness, trustworthiness and honesty. 
More than 100 companies, including Yahoo!, signed the pledge.
Perhaps the most significant development, however, was a 2004 guideline on internet censorship that called for Chinese universities to recruit internet commentators who could guide online discussions in politically acceptable directions and report comments that did not follow Chinese law. 
These commentators became known as wu mao dang, or “50-cent party”, after the small bonuses they were supposedly paid for each post.
Yet even as the government was striving to limit individuals’ access to information, many citizens were making significant inroads into the country’s political world – and their primary target was corrupt local officials.
In May 2009, Deng Yujiao, a young woman working in a hotel in Hubei province, stabbed a party official to death after she rejected his efforts to pay her for sex and he tried to rape her. 
Police initially committed Deng to a mental hospital. 
A popular blogger, Wu Gan, however, publicised her case. 
Using information gathered through a process known as ren rou sousuo, or “human flesh search engine”, in which web users collaborate to discover the identity of a specific individual or organisation, Wu wrote a blog describing the events and actions of the party officials involved.
In an interview with the Atlantic magazine at the time, he commented: “The cultural significance of flesh searches is this: in an undemocratic country, the people have limited means to get information... [but] citizens can get access to information through the internet, exposing lies and the truth.” 
Deng’s case began to attract public support, with young people gathering in Beijing with signs reading “Anyone could be Deng Yujiao.” 
Eventually the court ruled that Deng had acted in self-defence.
During this period, in the final years of Hu Jintao’s presidency, the internet was becoming more and more powerful as a mechanism by which Chinese citizens held their officials to account. 
Most cases were like that of Deng Yujiao – lodged and resolved at the local level. 
A small number, however, reached central authorities in Beijing. 
On 23 July 2011, a high-speed train derailed in the coastal city of Wenzhou, leaving at least 40 people dead and 172 injured. 
In the wake of the accident, Chinese officials banned journalists from investigating, telling them to use only information “released from authorities”. 
But local residents took photos of the wreckage being buried instead of being examined for evidence. 
The photos went viral and heightened the impression that the government’s main goal was not to seek the true cause of the accident.
A Sina Weibo poll – later blocked – asked users why they thought the train wreckage was buried: 98% (61,382) believed it represented destruction of evidence. 
Dark humour spread online: “How far are we from heaven? Only a train ticket away,” and “The Ministry of Railways earnestly requests that you ride the Heavenly Party Express.” 
The popular pressure resulted in a full-scale investigation of the crash, and in late December, the government issued a report blaming poorly designed signal equipment and insufficient safety procedures. 
As many as 54 officials faced disciplinary action as a result of the crash.
The internet also provided a new sense of community for Chinese citizens, who mostly lacked robust civil-society organisations. 
In July 2012, devastating floods in Beijing led to the evacuation of more than 65,000 residents and the deaths of at least 77 people. 
Damages totalled an estimated $1.9bn. 
Local officials failed to respond effectively: police officers allegedly kept ticketing stranded cars instead of assisting residents, and the early warning system did not work. 
Yet the real story was the extraordinary outpouring of assistance from Beijing web users, who volunteered their homes and food to stranded citizens. 
In a span of just 24 hours, an estimated 8.8m messages were sent on Weibo regarding the floods. 
The story of the floods became not only one of government incompetence, but also one of how an online community could transform into a real one.
While the Chinese people explored new ways to use the internet, the leadership also began to develop a taste for the new powers it offered, such as a better understanding of citizens’ concerns and new ways to shape public opinion. 
Yet as the internet increasingly became a vehicle for dissent, concern within the leadership mounted that it might be used to mobilise a large-scale political protest capable of threatening the central government. 
The government responded with a stream of technological fixes and political directives; yet the boundaries of internet life continued to expand.
The advent of Xi Jinping in 2012 brought a new determination to move beyond deleting posts and passing regulations. 
Beijing wanted to ensure that internet content more actively served the interests of the Communist party. 
Within the virtual world, as in the real world, the party moved to silence dissenting voices, to mobilise party members in support of its values, and to prevent foreign ideas from seeping into Chinese political and social life. 
In a leaked speech in August 2013, Xi articulated a dark vision: “The internet has become the main battlefield for the public opinion struggle.”
Early in his tenure, Xi embraced the world of social media. 
One Weibo group, called Fan Group to Learn from Xi, appeared in late 2012, much to the delight of Chinese propaganda officials. (Many Chinese suspected that the account was directed by someone in the government.) 
Xi allowed a visit he made to Hebei to be liveblogged on Weibo by government-affiliated press, and videos about Xi, including a viral music video called How Should I Address You, based on a trip he made to a mountain village, demonstrate the government’s increasing skill at digital propaganda.
Under Xi, the government has also developed new technology that has enabled it to exert far greater control over the internet. 
In January 2015, the government blocked many of the VPNs that citizens had used to circumvent the Great Firewall. 
This was surprising to many outside observers, who had believed that VPNs were too useful to the Chinese economy – supporting multinationals, banks and retailers, among others – for the government to crack down on them.
In spring 2015, Beijing launched the Great Cannon. 
Unlike the Great Firewall, which has the capacity to block traffic as it enters or exits China, the Great Cannon is able to adjust and replace content as it travels around the internet. 
One of its first targets was the US coding and software development site GitHub. 
The Chinese government used the Great Cannon to levy a distributed denial of service attack against the site, overwhelming it with traffic redirected from Baidu (a search engine similar to Google). 
The attack focused on attempting to force GitHub to remove pages linked to the Chinese-language edition of the New York Times and GreatFire.org, a popular VPN that helps people circumvent Chinese internet censorship.
But perhaps Xi’s most noticeable gambit has been to constrain the nature of the content available online. 
In August 2013, the government issued a new set of regulations known as the “seven baselines”. 
The reaction by Chinese internet companies was immediate. 
Sina, for example, shut down or “handled” 100,000 Weibo accounts found to not comply with the new rules.
The government also adopted tough restrictions on internet-based rumours. 
In September 2013, the supreme people’s court ruled that authors of online posts that deliberately spread rumours or lies, and were either seen by more than 5,000 individuals or shared more than 500 times, could face defamation charges and up to three years in jail. 
Following massive flooding in Hebei province in July 2016, for example, the government detained three individuals accused of spreading “false news” via social media regarding the death toll and cause of the flood. 
Some social media posts and photos of the flooding, particularly of drowning victims, were also censored.
In addition, Xi’s government began targeting individuals with large social media followings who might challenge the authority of the Communist party. 
Restrictions on the most prominent Chinese web influencers, beginning in 2013, represented an important turning point in China’s internet life. 
Discussions began to move away from politics to personal and less sensitive issues. 
The impact on Sina Weibo was dramatic. 
According to a study of 1.6 million Weibo users, the number of Weibo posts fell by 70% between 2011 and 2013.
The strength of the Communist party’s control over the internet rests above all on its commitment to prevent the spread of information that it finds dangerous. 
It has also adopted sophisticated technology, such as the Great Firewall and the Golden Shield. 
Perhaps its most potent source of influence, however, is the cyber-army it has developed to implement its policies.
The total number of people employed to monitor opinion and censor content on the internet – a role euphemistically known as “internet public opinion analyst” – was estimated at 2 million in 2013. 
They are employed across government propaganda departments, private corporations and news outlets. 
One 2016 Harvard study estimated that the Chinese government fabricates and posts approximately 448m comments on social media annually. 
A considerable amount of censorship is conducted through the manual deletion of posts, and an estimated 100,000 people are employed by both the government and private companies to do just this.
Private companies also play an important role in facilitating internet censorship in China. 
Since commercial internet providers are so involved in censoring the sites that they host, internet scholar Guobin Yang argues that “it may not be too much of a stretch to talk about the privatisation of internet content control”. 
The process is made simpler by the fact that several major technology entrepreneurs also hold political office. 
For example, Robin Li of Baidu is a member of the Chinese People’s Political Consultative Conference, an advisory legislature, while Lei Jun, founder and CEO of mobile phone giant Xiaomi, is a representative of the National People’s Congress.
Yet Xi’s growing control over the internet does not come without costs. 
An internet that does not work efficiently or limits access to information impedes economic growth. China’s internet is notoriously unreliable, and ranks 91st in the world for speed. 
As New Yorker writer Evan Osnos asked in discussing the transformation of the Chinese internet during Xi’s tenure: “How many countries in 2015 have an internet connection to the world that is worse than it was a year ago?”
Scientific innovation, particularly prized by the Chinese leadership, may also be at risk. 
After the VPN crackdown, a Chinese biologist published an essay that became popular on social media, entitled Why Do Scientists Need Google? 
He wrote: “If a country wants to make this many scientists take out time from the short duration of their professional lives to research technology for climbing over the Great Firewall and to install and to continually upgrade every kind of software for routers, computers, tablets and mobile devices, no matter that this behaviour wastes a great amount of time; it is all completely ridiculous.”
More difficult to gauge is the cost the Chinese leadership incurs to its credibility. 
Web users criticising the Great Firewall have used puns to mock China’s censorship system. 
Playing off the fact that the phrases “strong nation” and “wall nation” share a phonetic pronunciation in Chinese (qiangguo), some began using the phrase “wall nation” to refer to China. 
Those responsible for seeking to control content have also been widely mocked. 
When Fang opened an account on Sina Weibo in December 2010, he quickly closed the account after thousands of online users left “expletive-laden messages” accusing him of being a government hack. Censors at Sina Weibo blocked “Fang Binxing” as a search term; one Twitter user wrote: “Kind of poetic, really, the blocker, blocked.” 
When Fang delivered a speech at Wuhan University in central China in 2011, a few students pelted him with eggs and a pair of shoes.
Nonetheless, the government seems willing to bear the economic and scientific costs, as well as potential damage to its credibility, if it means more control over the internet. 
For the international community, Beijing’s cyber-policy is a sign of the challenge that a more powerful China presents to the liberal world order, which prioritises values such as freedom of speech. 
It also reflects the paradox inherent in China’s efforts to promote itself as a champion of globalisation, while simultaneously advocating a model of internet sovereignty and closing its cyber-world to information and investment from abroad.

dimanche 13 novembre 2016

Death by a thousand cuts: software development behind China’s Great Firewall

By Eva Xiao

If you’ve ever been to mainland China, chances are you’re familiar with the Great Firewall, the country’s all-encompassing internet censorship apparatus. 
You know the despair of not being able to open Facebook, the pain of going mute on Twitter. 
But with a good VPN, you can magic many of these inconveniences away – at least temporarily.
For software developers based in China, however, it’s not that simple. 
You’re not just censored from certain websites. 
Basic building blocks that you use for product development are suddenly beyond your reach. 
With software services and libraries spread across the globe, China’s internet sovereignty can be a real pain in the ass.
“There’s a whole parallel universe over here,” DC Collier, founder of Shanghai-based chatbot startup Rikai Labs, told me back in June. 
“I think Chinese developers are doing development work with one hand tied behind their back.”
DC has been a software developer for 20 years, building everything from CD-ROM games to Facebook apps and now, chatbots. 
When I ask how he deals with the Great Firewall, he says he travels overseas when he has a couple weeks of “serious coding work” ahead of him.
“Otherwise, just bang my head against the wall,” he tells Tech in Asia in an email.
To outsiders who have never developed software in China, it might sound like he’s joking. 
But he’s not.

Blocked – or slow as hell
The scope of the Great Firewall has grown along with the internet. 
Sadly, it’s a highly adaptable and robust system. 
In terms of software development, it means that a growing number of services are permanently or sporadically blocked.
One of those is NPM or Node Package Manager, an important tool for Node.js. 
To access NPM in mainland China, you’ll have to find workarounds like using a Chinese mirror. Another is Github, a popular version control and source code management tool that is occasionally blocked or at least throttled to be excruciatingly slow.
Things get worse when you try using anything related to Google: Google Analytics, Google Fonts, Google Maps. 
All blocked. 
Even open source tools from Google are inaccessible without VPN or some kind of detour, such as Tensorflow.
“We had to rewrite so much of our stack,” says DC. 
“In the US, you rely on so many external libraries but then every time you do a deploy here, it takes like 30 minutes because it’s pulling down libraries from someone else’s service. You have to set up all kinds of infrastructure to get around all of that stuff.”
“If you’re using third party APIs, like Facebook’s natural language processing APIs, you have to set up proxies to bounce that stuff around,” he adds. 
“It’s really painful.”
If you’re an Android developer and plan to develop for Google Play, be prepared to cry rivers of tears when you try to use Google’s Android services. 
Expect to wait hours to upload your app to the Play Store because your VPN is broken.
“Android’s system has some services, like push notifications and the Play Store and Google Maps. You can’t use any of them in China,” says Xin Qi, technical director at Ming Labs. 
When Xin Qi and his team make apps for the users both within and outside of China, they have to check the user’s location in order to use the right service.
“Our apps will have some deviation,” he continues. 
“When we get a GPS location, it’s 100 or so meters off. In China, there’s a GPS offset.” 
He’s referring to GCJ-02, a China-specific GPS coordinate system that will erroneously shift WGS-84 markers, such as GPS locations, on maps.
“When we retrieve coordinates, we have to fix them,” he sighs. 
“It’s not hard but it’s annoying.”

Hosting dilemmas
Unfortunately, the Great Firewall is only one piece of the Chinese internet. 
Even if you get around the blocked services, you might encounter problems endemic to the whole ecosystem.
A good example is web hosting. 
Alex Michaud, founder of Reddoor.House, a service that helps expats find housing, has struggled to find the right server to host his website. 
Cloud services in China are more expensive than their equivalents in the West, and exorbitantly so, he says.
“It’s not like two, three times more,” he says. 
“It’s like 100 times more expensive.”
For instance, though Alibaba Cloud’s basic Elastic Cloud Service package is roughly US$10 a month, it offers a measly bandwidth of 1 Mbps. 
Compare that to Linode, a cloud service based in the US, whose US$10 basic package comes with a bandwidth of 125 Mbps. 
To get something equivalent from Alibaba Cloud, you would have to pay around US$1,500 a month.
Things get more complicated when you want to service users both inside and outside of China. 
If you’re targeting the local market, it makes sense to use a data center based in China. 
But if you also want to serve the international market, you might need to pay more for a specialized service.
“Even though we also have users in Canada [and] Australia, 85 percent of our business is done in China,” says Gabriel Paquin, vice president of engineering at Education International Cooperation (EIC) Group, a counseling service provider for Chinese students who want to study abroad.
EIC uses Salesforce as its CRM system. 
It’s hosted in Japan though, because Salesforce doesn’t have a data center in China.
To circumvent that, EIC subscribes to Aryaka, a software-defined WAN service, which optimizes enterprise networks such as content delivery networks (CDNs).
“I do enterprise. We’re a big business,” says Gabriel. 
“I cannot hack a couple of Python libraries and it’s gonna be cool. Our business is a billion RMB business, it’s not small. […] I gotta go with enterprise services.”
Still, even with Aryaka, there’s no guarantee that the company’s CDN will work seamlessly. 
Gabriel and his development team have to ensure that sales apps running on company devices, such as tablets, can operate offline if they have to. 
The sales team cannot afford to wait for web pages to load when they are trying to close sales, he says.
“It has to be fast,” says Gabriel. 
“For example, let’s look at information from Harvard University. It would take forever to load. So for some of the key pages, we had to have a local cache on the device.”
Because so much data has to be saved locally, EIC has to buy devices with larger hard drives, he says. Thankfully, it’s an internal application.

No hope?
When I ask Zhang Wei, a senior developer at Ming Labs, what advice he would give overseas software developers that want to enter China, he says without hesitation, 
“Don’t come.”
“You’ll lose access to a lot of good services,” he explains. 
When you’re troubleshooting software, you’ll always have some doubts, he says. 
“You won’t know if it’s the VPN or the network connection. Sometimes it won’t work without VPN, and sometimes it won’t work with VPN.”
It’s hard to quantify how much productivity is lost as a result of troubleshooting and working around the Great Firewall. 
DC estimates that 50 percent of his productivity is lost, while Alex only describes it as hours and hours of lost time. 
“All the time you spend on those little problems […] it’s time that you don’t spend developing your product,” he says.
Ironically, the Chinese government wants the country to become a world leader in technology and innovation. 
At the same time, restrictions around freedom of speech are tightening and even VPNs are not guaranteed workarounds for the country’s rising Great Firewall.
The only advice I heard from developers was to keep things as local as possible – similar to Gabriel and his team – and to avoid anything with external resources. 
And when possible, use Chinese services.
Alex has lived in Shanghai for two years now. 
When he just moved to China in 2014, he felt optimistic about the country. 
It was developing fast and it felt more exciting than Canada’s tech scene, which he describes as conservative. 
At that time, he was sure that China’s internet restrictions would loosen over time. 
In hindsight, he was naive, he says.
“In China, you can really feel the frontier,” he says. 
“It’s the biggest intranet in the world.”