The Kabul airport program is also financed by the United States, with money and training provided by the American Embassy. Americans, like all other travelers, are subject to it.

“Some of the embassies are quite exercised about it,” one Western diplomat said. Such a program would be illegal if carried out in the home countries of most of the occupying coalition. The United States and Japan fingerprint all foreigners on arrival; South Korea plans to start doing so in January. (Brazil retaliated against the American program by fingerprinting arriving Americans only.) Officials at the American Embassy declined to comment specifically on the program; a spokesman for the Department of Homeland Security denied it had anything to do with it.

Biometric data is also being gathered by the American military at all of Afghanistan’s eight major border crossings, in a program that it plans to hand over to the Afghan government at the end of this month. So far, that program gathers only random samples at border crossings, because traffic is so heavy, but since it began in April it has already added 200,000 people to the military’s biometrics database.

The military wants to use biometrics to identify known or suspected insurgents, and to prevent infiltration of military bases and Afghan security forces. “The technology removes the mask of anonymity,” said Capt. Kevin Aandahl of the Navy, a spokesman for the military’s detainee operations, which include the biometrics program.

Gathering the data does not stop at Afghanistan’s borders, however, since the military shares all of the biometrics it collects with the United States Department of Justice and the Department of Homeland Security through interconnected databases.