Gen. Keith Alexander, director of the National Security Agency and head of the U.S. military’s Cyber Command, was heckled and narrowly avoided being egged when he addressed the Black Hat corporate computer security conference Wednesday.

“Bulls—t,” the heckler retorted — one of several to interrupt the general’s comments.

Another demanded Gen. Alexander read the Constitution — which brought the swift declaration the general had.

As the general’s speech was about to begin, security guards seized a carton of eggs from someone in the audience, according to Finnish security specialist Miko Hypponnen. Mr Hypponnen, who witnessed the incident, told his 51,000-plus followers on Twitter about it.

Gen. Alexander has been a guest at Black Hat before, but last year, he spoke for the first time at DefCon, the companion annual computer security conference that perhaps best expresses the non-conformist spirit of the hacker culture. By tradition, Black Hat and DefCon run one after the other during a single week in Las Vegas.

“We need some time apart,” Mr. Moss told the U.S. security agencies who have become a constant presence at so many computer security conferences.

Instead, Gen. Alexander spoke to the much more sympathetic audience at Black Hat.

He spent most of his allotted 45 minutes defending the NSA’s huge-scale sweeping up of data about every Americans’ phone calls revealed by leaker Edward J. Snowden; and fending off charges that his past public statements about the NSA’s domestic data-gathering activities have been misleading or simply untrue.