The message from the U.S. government to hundreds of thousands of young, undocumented immigrants in 2012 was clear: Come out of the shadows. Tell us your home addresses, where you study and work, and when you crossed the border. In exchange, you can stay in a country you already call home.

On Tuesday, President Trump revoked that offer. Yet detailed personal information about the nearly 800,000 immigrants who arrived as children in the United States survives in a federal database that could help law enforcement officials deport any one of them.

The dramatic shift in federal policy — created by an executive order by one president and rescinded by the next — has created what immigration advocates are calling a high-stakes data-privacy nightmare.

Trump administration officials say they will use the information judiciously, only to pursue cases against immigrants who have otherwise become threats to public safety or national security — as already was permitted during the Obama administration.

But immigrants and advocates fear the database under Trump could be turned against the "dreamers," who generally have been studying or working here for years, and in some cases serving in the U.S. military.

Much that is necessary to find and deport those who applied for the Deferred Action for Childhood Arrivals program is contained in the database: home addresses, phone numbers, financial information, and education and employment history, as detailed across several federal forms and backed by supporting documentation.

Even entries and exits from the country and visa expiry dates were required to complete the DACA application, giving government officials what amount to signed, dated admissions about violations of federal immigration law. All this information is now just a few clicks away on federal government computer systems.

"That is highly problematic and the opposite of the intent of this program," said Alvaro Bedoya, executive director of Georgetown Law's Center on Privacy and Technology. "It would be a historic betrayal of a very vulnerable people by their government. They're Americans by all intents and purposes."

Immigration advocates have been on edge since Trump removed Privacy Act restrictions on the DACA database and other immigration databases as part of an executive action in January. That lessened the already scant legal limits on how federal law enforcement agencies, such as Immigration and Customs Enforcement or Customs and Border Protection, could use this information.

Trump administration officials say the database has not been used to identify people who have overstayed their DACA waivers, and there are no plans to change that policy, said David Lapan, press secretary for the Department of Homeland Security.

"I don't want to leave the impression that somebody who was in DACA will never be potentially arrested, but they're not being targeted for arrest," Lapan said. "Even when the policy was created, [government officials] made clear it's not a path to citizenship. It's not a legal status. . . .If they had a sense of security previously, it was a bit false."

Unless Congress acts to restore the program in some form, more than 1,000 people a day are expected to lose their DACA waivers as the program is phased out beginning next year, according to the Center for American Progress.

"The government asked you to come out of the shadows and register for this program," said Ernestor De La Rosa, 28, a DACA recipient from Mexico who came to the United States as a teenager and now is the assistant finance director for Dodge City, Kan. "Now it has turned the tables and can use your information against you."

Few expected the political shift that arrived with the election of Trump, who campaigned on pledges to crack down on illegal immigration. Increasingly aggressive enforcement actions and sharp rhetoric from Trump have alarmed civil liberties groups and immigration advocates, making them skeptical that promises to respect traditional limits on using data will be respected.

"The signals this administration has sent to immigration agents in the field is that the gloves are off," said Michael Tan, a staff attorney for the ACLU's Immigrants' Rights Project. "The firewalls or constraints are subject to being undermined."

Karina Macias Sandoval, 22, was taken to Northern California from Mexico at age 3 and completed her schooling in the United States. DACA allowed her to get a work permit and to do internships for nonprofit groups and Hewlett-Packard. Now she has a job with a San Francisco Bay-area biotech firm but is worried about the future.

"They say we're not a priority for deportation, but let's say if there were more pressure on Trump to do something, we are that easy target for him to prove a point," Sandoval said.

The rules regarding the DACA database could ultimately be resolved through litigation, as several immigration rights groups have threatened to challenge Trump's executive order in court. Already, the attorneys general from 15 states filed suit on Wednesday to oppose Trump's move to end the program and sought to bar the government from using personal information submitted for DACA for other purposes such as law enforcement.

In any court case, a key factor will be the representations made under the Obama administration regarding how information submitted by dreamers could be used.

A federal government FAQ about the program issued in 2012 assured applicants that information they submitted about themselves or family members would not be referred to law enforcement for purposes of deportation, but there were stated exceptions for "national security purposes" or "the investigation or prosecution of a criminal offense."

The document also noted that the rules of the program could "be modified, superseded, or rescinded at any time without notice."

But the longevity of DACA may have given applicants reasonable expectations that the rules would continue in their current form, said Seth Grossman, former deputy general counsel for the Department of Homeland Security.

"These arguments are strong," said Grossman, who is the chief of staff to Janet Napolitano, a former secretary of Homeland Security under Obama and now president of the University of California system, in which several thousand dreamers are students.

A legal battle could raise broader issues about how the federal government sometimes uses data collected for one purpose to pursue other purposes when priorities change — something more heavily restricted in many other countries.

"This really highlights the fact that, in the U.S., the privacy and data protections we have are not strong enough to prevent some kinds of large-scale abuses," said Sarah St. Vincent, an advocate on U.S. national security, surveillance and domestic law at Human Rights Watch. "Congress really needs to stand up."

Follow The Post's tech blog, The Switch, where technology and policy connect.