In an email filed in Manhattan federal court by Perez's defence lawyers, Madoff described a meeting in which he said he told Perez and another programmer, Jerome O'Hara, that the trading at his firm was legitimate.

"They (asked) if I was buying the securities that they showed on the reports," Madoff wrote from his North Carolina prison, where he is serving a 150-year sentence. "I answered, 'of course' and explained that I had trading and custodial arrangements with all the major investment banks in Europe and the U.S. who traded with us every day."

In the filing, the lawyers argued that Madoff's description of the meeting undermined the government's thesis that Perez and O'Hara were aware the reports they were creating for outside auditors were based on fake trades.

The two programmers were found guilty on all counts in March along with three other former Madoff employees – back office director Daniel Bonventre and portfolio managers Annette Bongiorno and Joann Crupi – following a nearly six-month trial.

Prosecutors have asked for more than 20 years in prison for Bonventre and Bongiorno, more than 14 years for Crupi and more than eight years for Perez and O'Hara.

According to the email correspondence, Madoff reached out to the defence lawyers and offered to provide information that might help their cases.

"I assure you that my info in each of you clients (sic) cases is of great value and discredits the testimony provided by frank D," he wrote on Sept. 29 in an email with several typographical errors, referring to the government's star witness and his former deputy, Frank DiPascali.

At trial, DiPascali testified about the meeting involving Madoff, Perez and O'Hara that took place in September 2006.

According to DiPascali, the two programmers confronted Madoff after expressing concerns they had given fake data to government regulators.

DiPascali claimed the men refused to continue creating data reports and demanded additional pay, including a suggestion that they be paid in diamonds.

Lawyers for the two men have disputed that account, saying their clients had legitimate concerns and that they accepted Madoff's explanation during the meeting.

"In our view, the government's arguments in this regard have no support in the record and are based on sheer speculation," wrote Larry Krantz, a lawyer for Perez, in the court filing.

Federal prosecutors have not yet filed a response. A spokeswoman for the office of Manhattan U.S. Attorney Preet Bharara declined to comment.

(Reporting by Joseph Ax; Editing by Richard Chang)

By Joseph Ax