Danielle Allen is a professor of social science at the Institute for Advanced Study. Her forthcoming book is “Our Declaration: A reading of the Declaration of Independence in Defense of Equality.” She is on Twitter: @dsallenias.

In the wake of revelations about the National Security Agency’s collection of Americans’ communications, many have invoked citizens’ rights to speech and privacy. Tightly linked, also fundamental and equally under assault is the right of association. Rigorous protection of this right is a key legacy of the civil rights movement.

The First Amendment protects “the right of the people peaceably to assemble, and to petition the Government for a redress of grievances,” but this was not initially interpreted by the courts as a general right of association. Instead, it was construed to indicate protection of specific efforts of people to assemble to appeal to the government for the correction of grievances. Only through the civil rights movement was the Constitution’s protection of assembly clearly defined by courts as “the right to associate,” regardless of “whether the beliefs sought to be advanced by association pertain to political, economic, religious, or cultural matters.”

The Supreme Court first formally identified a right to associate in NAACP v. Alabama , a 1958 case in which the state had tried to force out the NAACP with a string of measures, including a requirement that the unincorporated local associations disclose their membership lists. The court confirmed the right of associations to protect such lists and the right of individuals to participate anonymously in such associations. “It is hardly a novel perception that compelled disclosure of affiliation with groups engaged in advocacy may constitute [an] effective . . . restraint on freedom of association,” the justices wrote.

About that time, two municipalities in Arkansas tried to force the disclosure of NAACP membership lists through a tax provision. Again, the Supreme Court upheld the link between a right to anonymous participation and the right of association and, by invoking the 14th Amendment, required states to respect that First Amendment right. In 1960 in Bates v. Little Rock , the court cited its ruling in NAACP v. Alabama, saying, “It is now beyond dispute that freedom of association for the purpose of advancing ideas and airing grievances is protected by the Due Process Clause of the Fourteenth Amendment from invasion by the States. . . . Freedoms such as these are protected not only against heavy-handed frontal attack, but also from being stifled by more subtle governmental interference.”

In 1963, the court handed down NAACP v. Button . Here, too, a state government — Virginia — had sought to compel disclosure of membership lists and prohibit efforts to encourage litigation as a form of activism. In this case, the state courts were obliged to acknowledge that the compelled disclosure of members was unconstitutional. The question about advocacy through litigation was what moved on to the Supreme Court.

The men and women who marched in Washington in 1963 had formed extensive social networks in the preceding years, in part because they were protected by the court’s new articulation of a “right to associate.” It is this right, above all, that has been undone by the National Security Agency’s surveillance program. All of our memberships in social networks — which are no different from “associations,” except for not necessarily having a specific geographical locale — have been compulsorily disclosed. The Obama administration says that it’s not looking at the data but is acquiring information about our networks — who is talking to whom — in case it wants to look later. This reminds me of the child who puts his hands over his eyes and thinks you can’t see him.

In all of its decisions on the right of association in the civil rights era, the Supreme Court acknowledged that there may be compelling state interests that require overriding even citizens’ most precious rights. In NAACP v. Alabama, the court explained that in 1928 it had upheld the compelled disclosure of membership in a case from New York involving the Ku Klux Klan; the justices accounted for that decision as “based on the particular character of the Klan’s activities involving acts of unlawful intimidation and violence” — in other words, terrorism. The court identified the NAACP, by contrast, as a lawful organization; it had complied with the law in Alabama but for refusing to hand over its membership lists. In Button, the court similarly identified the NAACP as “advocating lawful means of vindicating legal rights.”

How should the government pursue instances that involve a compelling state interest? Only with narrowly targeted instruments. In Shelton v. Tucker, a related right of association case from Little Rock decided in 1960, the justices wrotethat “even though the governmental purpose be legitimate and substantial, that purpose cannot be pursued by means that broadly stifle fundamental personal liberties when the end can be more narrowly achieved.”

The NSA’s data collection program is anything but narrowly tailored to a compelling state interest. Instead, it treats every American as potentially a party of interest to unlawful activity. How can that not affect how I think about my associations from this day forward? I’m not sure this form of governmental interference is even all that “subtle.”

The Post’s View: 50 years after the march, President Obama pays tribute