After getting reams of bad press for detaining Glenn Greenwald’s domestic partner at Heathrow Airport for almost nine hours under the Terrorist Act’s Schedule 7, the British government got a chance to make its case in court today for why they stopped him at all.  The hearing turned out to be very educational, as testimony indicates that the cache stolen by Edward Snowden from the NSA may be much larger than anyone has estimated so far, and includes around 58,000 documents belonging to British intelligence, too.  Furthermore, the government alleges that the material carried by Miranda could have exposed its intelligence operatives in dangerous assignments, if seized:

British authorities revealed Friday that NSA leaker Edward Snowden took at least three times as many highly sensitive documents as previously reported, and possibly far more.

At a court hearing in London the government told a judge that David Miranda, the partner of Guardian journalist Glenn Greenwald, was carrying 58,000 documents related to British intelligence on electronic devices when he was stopped and searched at Heathrow airport on August 18. The government also said it believed the documents had been “stolen” from Government Communications Headquarters (GCHQ), the British counterpart of the NSA. …

In a signed statement revealed at Friday’s hearing, a detective superintendent with the Counter-Terrorism  branch of the Metropolitan Police said that the material on an “external hard drive” seized from him “discloses approximately 58,000 UK documents of the highest level of classification.”

Previous estimates of Snowden’s cache put the total closer to 20,000, although these are just guesstimates at best.  The NSA, as it turns out, didn’t have the kind of controls in place for them to know just how much Snowden managed to purloin while working in two consecutive jobs as a contractor to the agency.  Of course, the NSA also didn’t have enough security in place to keep the files from being stolen in the first place, which would have been a little more helpful.

That’s not to say Snowden and his allies are all that much better at operational security. Had other intelligence services managed to intercept Miranda and steal his material, they would have found it pretty easy to decrypt some of it:

The government was able to decrypt some of the files using a code found on a piece of paper carried by Miranda, but is struggling to decrypt the rest.

“So far only 75 documents have been reconstructed” into a legible format, said the statement. “This represents only a tiny fraction of what was seized.” …

In a separate statement to the court, Oliver Robbins, Britain’s deputy national security advisor for intelligence, chided Miranda for carrying a password on a piece of paper. “The fact that … claimant was carrying on his person a handwritten piece of paper containing the password for one of the encrypted files,” said Robbins, “is a sign of very poor information security practice.”

The Telegraph headlined that development, and notes that the British government got more time from the court to continue looking at the data, and whether to prosecute Miranda — under the Terrorism Act, as it turns out:

In a written statement handed to the High Court in London, a senior Cabinet Office security adviser said it showed “very poor judgment” by David Miranda and other people associated with him.

Senior judges agreed to issue a court order which allows Scotland Yard to continue to examine data from nine electronic devices seized from Mr Miranda on August 18.

But the terms of the order were widened so police have specific permission to analyse whether Mr Miranda, and others, have breached the Official Secrets Acts or a section of the Terrorism Act 2000 which make it an offence to possess information which may be useful to terrorists.

The government has been forced to assume that copies of the information held by Mr Snowden, who worked for the US National Security Agency, are now in the hands of foreign governments after his travel to Moscow via Hong Kong, Mr Robbins said.

Disclosure of the material could put the lives of British intelligence agents or their families at risk, the court heard, and the general public could also be endangered if details about intelligence operations or methods fell into the wrong hands.

Joshua Foust connects a few dots in an update, after running down an impressive list of details from the hearing:

Another Telegraph journalist, Tim Stanley, also pointed out some important inconsistencies between Miranda’s initial statements about his detention and how he describes it now. For example, right after Miranda’s detention, Greenwald said he did not have a decryption key. Twitter @snarkamendment discovered it:

@FlexYourRights He only gave up the pws to his Facebook and email accounts, which reveal nothing. They threatened him w/prison if he didn’t.

— Glenn Greenwald (@ggreenwald) August 20, 2013

Like many statements he has made over the past two months, further details throws doubt on its veracity.

Either way, if the government’s description of the data is true — so far Greenwald’s vague assertion that it’s a “lie” is about all that contradicts it — then Greenwald and Poitras have potentially life-threatening information in their possession. When compared with Greenwald’s threats to punish the UK government for his husband’s detention, I would imagine the British government is rather angry and worried.

Stay tuned.