NEW YORK (Reuters) - Accused Mexican drug cartel boss Joaquin “El Chapo” Guzman was so preoccupied with spying on his associates he had software installed on their phones to monitor their texts and conversations, a key prosecution witness testified on Wednesday, an opening the FBI would later exploit.

Emma Coronel Aispuro, the wife of Joaquin Guzman, the Mexican drug lord known as "El Chapo", arrives at the Brooklyn Federal Courthouse, for the trial of Guzman in the Brooklyn borough of New York, U.S., January 9, 2019. REUTERS/Brendan McDermid

Christian Rodriguez, a technician who said he worked for Guzman from 2008 to 2012 and set up a secure communication system for the cartel, took the stand in federal court in Brooklyn to testify in Guzman’s U.S. trial.

Rodriguez said he handled Guzman’s requests to install spyware on about 50 “special phones” he wanted to track. The software allowed Guzman to monitor users’ calls and texts, and even to turn on a phone’s microphone and record at any time without the user’s knowledge.

FBI agent Steven Marston testified earlier on Thursday that U.S. authorities obtained text messages from phones used by Guzman’s wife and apparent mistress thanks to the spyware.

Guzman, 61, was extradited to the United States in 2017 to face charges of trafficking cocaine, heroin and other drugs into the country as leader of Mexico’s Sinaloa Cartel.

Rodriguez began cooperating with the FBI while still working for Guzman, allowing investigators to tap into the cartel’s encrypted phone network. His testimony was accompanied by special security precautions, with sketch artists instructed not to draw his face.

Rodriguez said he personally installed spyware on about 50 phones. The technician said he heard from associates of Guzman that their boss treated the technology “like his toy,” often using it to hear what people said about him immediately after he called them.

Slideshow ( 4 images )

Rodriguez’s testimony is expected to continue on Thursday.

Marston had earlier on Wednesday read for the jury text messages from early 2012 the FBI collected through Guzman’s spyware.

One of Guzman’s lawyers, Jeffrey Lichtman, cross-examined Marston about his identification on Tuesday of Guzman’s voice on recordings, but did not question the authenticity of the texts.

Some texts show Guzman and his wife, Emma Coronel, discussing the hazards of cartel life. When Coronel said she was being watched by law enforcement, Guzman advised her to “live a normal life.” In one message, Coronel assured Guzman that she still had a gun he had given her.

After a raid on a house in the Mexican beach resort of Los Cabos that captured several of his associates, Guzman told Coronel he had escaped through a window. He asked her to buy him some necessities, including aftershave and black moustache dye.

The couple also discussed a one and a half-year birthday party for their twin daughters, Emmely “Mali” and Maria Joaquina “Kiki” Coronel.

“Our Kiki is fearless,” Guzman told Coronel in one message. “I’m going to give her an AK-47 so she can hang with me.”

Coronel watched the testimony impassively, though she seemed to become uncomfortable when Marston began reading apparently romantic texts between her husband and another woman, Agustina Cabanilla, who addressed him as “love.”

Other texts showed Cabanillas helping to set up drug deals by passing information between Guzman and various other people, including one who used the name “War Princess.”

In one message to a friend, Cabinillas called Guzman a “jerk” who was trying to spy on her. But she dismissed the concern.

“Guess what? I’m smarter than him,” she told the friend.