WASHINGTON – A few weeks after announcing an ambitious defense initiative dubbed “Star Wars,” President Ronald Reagan found himself at Camp David watching “War Games.”

If you haven’t seen it — or weren’t around back then, it stars Matthew Broderick as a young hacker. His character accidentally infiltrates the NORAD supercomputers that control the country’s nuclear weapons, and he nearly sets off World War III in the process. (Don’t worry, though; in the end, nuclear war was avoided.)

Reagan was intrigued.

A few days later, the president described the plot during a meeting with congressmen and his national security advisers.

Reagan asked the chairman of the Joint Chiefs of Staff if something like that could happen in real life. Gen. John Vessey looked into it and found that, indeed, “War Games” wasn’t far from reality. The government’s computer systems were vulnerable.

A few months and a few interagency studies later, Reagan signed the first presidential directive on cybersecurity, which warned that new personal computers on the market were “highly susceptible to interception,” including by enemy states, criminals and terrorists.

The story appears in Fred Kaplan’s new book, “Dark Territory: The Secret History of Cyber War,” a collection of stories that follow the evolution of cyberwarfare over the past few decades.

The Reagan story, he said at a New America event Monday, began to show security officials how serious the cyberthreat was.

“You don’t need a Manhattan Project,” he said. “You just need a room of people who are adept with computers.”

The book leans on insider accounts, but it also has a bit of a Hollywood theme.

Here’s another example: Former National Security Agency Director Mike McConnell watched the 1992 movie “Sneakers” that  features Robert Redford as a young hacker who helps the NSA foil a Russian plot to access a “black box” that can crack encrypted files.

Kaplan said McConnell saw the movie when the NSA was having an identity crisis: The Cold War had just ended, and the agency was transitioning to a new era. “Sneakers” apparently inspired McConnell to shift the agency’s focus toward cyber issues, a shift still felt today.

But not everyone’s a fan of Kaplan’s anecdotal approach: P.W. Singer, a Brookings Institution senior fellow who specializes in cybersecurity, said that the stories Kaplan selected may be interesting, but they leave holes in the field’s recent history.

In a book review for The New York Times, Singer argued the book focuses too much on the government’s long-held fear of a “cyber Pearl Harbor,” an event that has yet to happen.

“What did happen instead was a wide range of other activities below the level of outright conflict, from digital espionage to mass intellectual-property theft to cybercrime costing hundreds of billions of dollars,” he wrote. “These harms all get short shrift, again reflecting the sources and focus of a book that presents its history only through a Washington, D.C., NSA-centric lens.”

Despite the criticism, there was a decently long line to buy the book after Kaplan’s talk. Maybe buyers were hoping to figure out what other cyber decisions have been based on movies.

But if Kaplan wants to write a sequel with that Washington-centric focus, will it contain a top administration official changing cyberpolicy based on last season’s “House of Cards,” with its focus on a double-agent hacker working inside the government? Stay tuned.