On Christmas Day, 2015, Turkish intelligence breached an encrypted messaging app called ByLock—an apparently homemade network with two hundred thousand users. According to Turkish officials, it was set up not long after Erdoğan began purging suspected Gülenists from the government. When the network was discovered, the server, in Lithuania, quickly closed down, and its users switched to Eagle, another encrypted messaging app. “They went underground,” a Turkish government aide told me.The intelligence officials say that they were able to decrypt the exchanges, and one told me, “Every conversation was about the Gülen community.” By checking the ByLock users’ names against government records, they found that at least forty thousand were civil employees, mostly from the judiciary and the police department. In May, two months before the coup, the government began suspending them.In July, the intelligence department notified the military that it had also identified six hundred officers of the Turkish Army, many of them highly ranked, among the ByLock users. Military officials began planning to expel them at a meeting of senior generals that was scheduled for early the next month. “We think the coup happened in July because they needed to move before they were expelled,” Ibrahim Kalın, the Erdoğan aide, told me.