The Internet was supposed to be about the free flow of ideas, but there is a dark side to such openness. (Kirill Kudryavtsev/AFP/Getty Images)

Can freedom survive the Internet?

In the first generation of the online revolution, the question would have seemed absurd. Connectivity was the ultimate freedom, allowing individuals to slip the surly bonds of time and space to read what they want, work when they want, shop where they want; to customize their tastes in music, humor, politics and titillation; to make friends on every continent and to troll enemies in every manner of disguise.

The Internet was liberty’s killer app, enabling the free flow of information and empowering the weak against the strong. Tyrants would tumble and totalitarianism crumble in its cleansing current. Recalling then-President Bill Clinton’s 1998 trip to Beijing, one author captures the widespread optimism of those early days: “In the 1990s, in the wake of Tiananmen Square and the subsequent government crackdown, it was an article of faith in Washington that the Internet would change China more than China would change the Internet.”

That’s David E. Sanger in his timely and bracing new book, “The Perfect Weapon: War, Sabotage and Fear in the Cyber Age.” Sanger is the national security correspondent at the New York Times. With the deep knowledge and bright clarity that have long characterized his work, Sanger recounts the cunning and dangerous development of cyberspace into the global battlefield of the 21st century.

He makes a strong case for applying concepts from the Geneva Conventions and nuclear arms control to establish some boundaries around the chaos of cyberwar. Certainly worth a try.

But for me, the takeaway from Sanger’s book was a fuller understanding of the extent to which digital technology and connectivity are turning the traditional strengths of free society into vulnerabilities.

Dispersion of power, for example. Central to the success of the American experiment — its vibrant economy and stable government — is the idea that individuals are fallible but crowds can be wise. Rather than concentrate political power in one leader or one cadre, we divvy it up among two parties, three branches, 50 states and many millions of voters. Rather than run the economy by central committee, we lean toward setting it loose on a sea of the wants and needs of buyers and sellers.

Sanger explains that this philosophy, applied to the digital age, creates opportunities for our totalitarian rivals. Big banks and other major institutions have spent billions to defend their hackable systems against enemy attacks — yet our society is more target-rich for hackers than before. “As we put autonomous cars on the road, connect Alexas to our lights and our thermostats, put ill-protected Internet-connected video cameras on our houses, and conduct our financial lives over our cell phones, our vulnerabilities expand exponentially,” he writes. Meanwhile, China and other illiberal societies tightly grip their digital networks and wield them as tools of social control.

Likewise, America’s strong tradition of dissent will be sorely tested in the age of cyberwar. Sanger documents years of fallout from the massive hack of national security files in 2013 by the dissident contractor Edward Snowden. Enemies were strengthened, allies were alarmed, and millions of Americans demanded that leading technology companies break off cooperation with U.S. intelligence agencies. Such whistleblowing is a proud tradition of free societies, but never has it been possible on such a vast and indiscriminate scale. The Pentagon Papers would fill a bookshelf; Snowden’s stolen trove would fill a whole library.

Meanwhile, the Russian hack of the 2016 election revealed the vulnerability of U.S. social media to foreign propaganda. As Sanger tells it, we’ve come to see that comity and trust are just as vital and just as exposed to cyberattacks as power grids and water systems. Less clear, though, is how to recover those damaged values in a land of free speech and consumer choice, where there’s big money to be made and votes to be won by stoking partisan fires.

Finally, the digital revolution has significantly reduced the competitive advantage of America’s wealth. Since the 1940s, when the industrial might of the United States guaranteed its victory in World War II, no nation or group of nations could long sustain an arms race with us. But “a cyber arsenal” is “the great leveler,” Sanger observes. An enemy as poor and backward as North Korea can deploy hackers capable of disrupting a company the size of Sony or a bank as powerful as JPMorgan Chase. In fact, poverty can be an advantage in this competition. “A country cut off from the world, with few computer networks, is a lousy target” for cyber-counterattacks, Sanger notes.

A reader finishes this book fully understanding why cyberwar has moved rapidly to the top of America’s official list of national security threats. And why, for the first time in three generations, this nation’s power in the world is seriously threatened. We’ve staked our fortunes on freedom and openness; now our enemies are turning both against us.

Read more from David Von Drehle’s archive.