With little notice and only occasional complaints, the American military and local authorities have been engaged in an ambitious effort to record biometric identifying information on a remarkable number of people in Afghanistan and Iraq, particularly men of fighting age.

Information about more than 1.5 million Afghans has been put in databases operated by American, NATO and local forces. While that is one of every 20 Afghan residents, it is the equivalent of roughly one of every six males of fighting age, ages 15 to 64.

In Iraq, an even larger number of people, and a larger percentage of the population, have been registered. Data have been gathered on roughly 2.2 million Iraqis, or one in every 14 citizens — and the equivalent of one in four males of fighting age.

To get the information, soldiers and police officers take digital scans of eyes, photographs of the face, and fingerprints. In Iraq and Afghanistan, all detainees and prisoners must submit to such scrutiny. But so do local residents who apply for a government job, in particular those with the security forces and the police and at American installations. A citizen in Afghanistan or Iraq would almost have to spend every minute in a home village and never seek government services to avoid ever crossing paths with a biometric system.

What is different from traditional fingerprinting is that the government can scan through millions of digital files in a matter of seconds, even at remote checkpoints, using hand-held devices distributed widely across the security forces.