Benjamin J. Rhodes, a top national security aide to President Barack Obama, in 2016.

WASHINGTON — For years, opponents of the nuclear deal with Iran have accused Benjamin J. Rhodes, a top national security aide to President Barack Obama, of scheming to sell the diplomatic agreement on false pretenses to the American people.

Now, just as President Trump appears likely to announce his decision to withdraw from the deal, evidence has surfaced that the agreement’s opponents engaged in a sophisticated effort to dig up dirt on Mr. Rhodes and his family that continued well after the Obama administration left office.

A detailed report about Mr. Rhodes, compiled by Black Cube, a private investigations firm established by former intelligence analysts from the Israel Defense Forces, contains pictures of his apartment in Washington, telephone numbers and email addresses of members of his family, as well as unsubstantiated allegations of personal and ethical transgressions.

In a separate case in 2017, the same firm was hired to gather dirt on women accusing Harvey Weinstein, the movie mogul, of multiple instances of sexual misconduct.

It is unclear who hired Black Cube to prepare the report on Mr. Rhodes and a similar report on Colin Kahl, the national security adviser to Vice President Joseph R. Biden Jr., which were obtained by The New York Times from a source with knowledge of their provenance.

The Guardian, which first published the existence of the reports on Mr. Rhodes and Mr. Kahl, said aides to Mr. Trump hired the firm, but there is no evidence in the documents that indicate any connection to anyone in Mr. Trump’s administration. A spokesman for the company vehemently denied any connection to the president.

“Black Cube has no relation whatsoever to the Trump administration, to Trump aides, to anyone close to the administration or to the Iran nuclear deal,” said Ido Minkowski, the company’s spokesman. “Anyone who claims otherwise is misleading their readers and viewers.”

One person with knowledge of the reports suggested that the company had been hired by a commercial client with an interest in opposing the nuclear deal.

The reports appear to be aimed at undermining public support for the agreement by finding ways to discredit Mr. Rhodes and Mr. Kahl, who have been staunch advocates of the deal on social media and in television appearances. In an interview on Monday, Mr. Rhodes said he was surprised that ferocious criticism directed at him continued after he left government.

“I never imagined that upon leaving government,…