WASHINGTON — Tens of thousands of images of travelers and license plates stored by the Customs and Border Protection agency have been stolen in a digital breach, officials said Monday, prompting renewed questions about how the federal government secures and shares personal data.

An official at the agency said it learned on May 31 that a federal subcontractor had transferred copies of the images to the subcontractor’s network, which the agency said was done without its knowledge and in violation of the contract. The subcontractor’s network was then hacked.

The hacked material did not include images from airports, but rather of drivers in their cars and license plates of vehicles crossing through one port of entry over a six-week period, officials said. One United States government official said no more than 100,000 people had their information compromised by the attack.

If that number holds, it would be far smaller than a 2014 breach at the Office of Personnel Management, which lost roughly 22 million security clearance files for government officials and contractors. In that case, China was later identified as the nation that had pulled off what remains the largest known theft of United States government data.