WHEN Egyptian lawyer Ahmed Gad stepped out of a cafe on the outskirts of Cairo to take a call last October, a gunman on the back of a motorcycle trained a semi-automatic rifle on him and opened fire. Three bullets ripped into Gad's right side before his attackers sped off. Gad, who survived, said the men were trying to silence him for his attempts to expose corruption in one of Egypt's most important commodity markets: wheat. Wheat can be a matter of life and death in Egypt. The country is the world's biggest importer of the grain, in large part because Cairo runs a bread subsidy program that feeds tens of millions of poor Egyptians. Wheat shortages have triggered riots in the past, and when Egyptians rose up against autocrat Hosni Mubarak in 2011 one of their signature chants was "Bread, freedom and social justice." The pressures have returned over the past few months as Egypt has faced potential wheat shortages because of its strict ban on imports of wheat infected with ergot, a common fungus. The hardest blight to eradicate, though, has been corruption. President Abdel Fattah El-Sisi has made ending corruption — including graft in the wheat industry — one of his government's priorities. In 2014, his government rolled out a system of smart cards designed to stop unscrupulous bakeries selling government-subsidized flour on the black market. Cairo says the system has been a big success, saving millions of dollars in bread subsidies, reducing imports, and ending shortages that once prompted long queues outside bakeries across the country. Supplies Minister Khaled Hanafi told Egyptian reporters in late 2014 that roughly 50 percent of the country's flour supply was stolen. In December last year he told Reuters that the new system had saved more than 6 billion Egyptian pounds ($766 million) worth of flour. But industry officials, traders and bakers say those reforms have failed — and even made abuse of the system worse. Eight sources in the wheat industry said the smart card system could be hacked, allowing some bakers to falsify receipts and request far more subsidized flour than they officially sold. Instead of reducing the amount of flour the state paid for, the critics said, the smart card system actually increased it. That triggered a wave of fraud higher up the supply chain that the sources say cost the country hundreds of millions of dollars last year. Internal statistics produced by the Supplies Ministry and reviewed by Reuters suggest the problems with the smart card system were considerable. The data show that consumption of state-subsidized flour rose in early 2015 in 12 of the 19 provinces where the smart card system had been introduced. In February 2015, consumption of subsidized flour was 955,000 ton, the data show, up from 750,000 ton the previous February. The government concedes there were teething problems in the smart card system that temporarily drove up consumption. But it said the problem was limited and was dealt with. Whatever the case, the extra consumption early last year drained government grain reserves. By last May, ministry data show, wheat reserves had fallen to just 435,000 ton, enough for about two weeks' supply and far below the stock of three to four months normally held by the state. Flour traders said that the government tried to paper over the shortage by declaring a bumper domestic harvest last year and then quietly filling the gap by buying extra imported wheat. In fact, the traders and one former adviser to the supplies minister said, the harvest was no bigger than normal. It was not possible to verify the size of the harvest. Nader Nour El-Din, a former adviser to the supplies minister and now a professor of agriculture at Cairo University, said it was inconceivable for the harvest to have been as big as the government said because the area under wheat had not increased in size, production methods had not changed and fertilizer use had not increased. The government denied that it faced a wheat shortage. In his December interview with Reuters, Supplies Minister Hanafi said that wheat levels were deliberately reduced in the first five months of 2015 to clear space in silos for the expected bumper crop. "We never, (and) we are not facing at all, a shortage in the reserves," he told Reuters. "The opposite is true." Smart system hacked The smart card system was designed to end corruption. The scheme provides each family with a plastic card allowing them to buy five small flat loaves of bread per family member a day. A family member must swipe their card through a machine every time they visit a bakery — so the supplies ministry can track exactly how much bread each bakery sells. The government then pays each bakery a subsidy per loaf. Until the smart card system, the ministry relied on bakeries to report how much bread they sold. But many bakeries overstated the amount and then sold the extra on the black market. The government has said the new system stopped that over-reporting. But four bakers, three wheat traders and a miller told Reuters that the system was possible to cheat. The smart cards and the machine that reads them were produced by SMART, a private company based in Cairo. According to the traders and bakers, employees at SMART secretly produced cards that resemble the ordinary smart card but act as a "master" that overrides the system. By swiping a master card through their machine, bakers were able to reset the system and then swipe ordinary smart cards multiple times. SMART employees sold the cheat devices to bakeries for several thousand dollars, according to rival bakers. One grocer in the industrial suburb of Helwan, outside Cairo, described how merchants in his neighborhood cheated the system: "The card is entered into the machine and the ration spent but the device can then reset the card allowing more spending. So instead of spending once or twice a month you can spend 1,000 times," said the grocer. He said bakers and other shopkeepers who did not want to take part in the scam complained to the supplies ministry, which subsequently began clamping down. Supplies Minister Hanafi acknowledged the smart card system had been compromised but described the problems as "very marginal and minor." He said the ministry immediately investigated any suspicious increase in flour consumption. "Of course for any system for the Internet... there is a very minor percent of hacking," Hanafi said. But he added: "If there is any increase not justified in the consumption, our people directly go and take care of it." Attiya Hamad, head of the bakeries division at the Cairo Chamber of Commerce, said the government had closed scores of bakeries for cheating and thrown many bakers in jail. Sitting in his tiny office, tucked inside a government bakery in the working class Cairo neighborhood of Zawya, Hamad said that despite the crackdown and new caps on how much flour each bakery can buy, the system could still be manipulated using the unofficial master cards. Hanafi said the problems had been dealt with. A bumper crop? Low wheat stocks fueled another scam. Last June, the supplies ministry said that thanks to Egypt's bountiful harvest, it had bought a record 5.3 million ton of domestic wheat, up from around 3.5 million ton a year in the previous few years. But traders and millers say the domestic harvest was no bigger than normal. They estimate that some 2 million tons of the 5.3 million ton the state said it bought was either imported or existed only on paper. The traders, millers and former ministerial adviser who spoke with Reuters also allege that companies sold imported wheat to the Ministry as Egyptian wheat so they could receive the better subsidized price. The state paid around $370 a ton for domestic Egyptian wheat, according to the government's published data, or $150 a ton more than the global spot price. Hesham Soliman, president of Med Star for Trading, a medium-sized wheat importer, said he complained to the central bank that the (harvest) number was inaccurate and made it hard for private companies to gauge demand and plan how much they should import. "This (such a large crop) has never happened in 30 or 40 years," he said. Waleed Diab, managing director of Egyptian Millers Company, one of the country's three largest millers, said the supplies ministry allowed a "corrupted" system to continue "to cover up for the decrease in strategic reserves." In all, the sources estimate, local suppliers made an extra 2 billion Egyptian pounds ($255 million) by selling the ministry imported grain. Last month the government reversed a plan to reform the Egyptian wheat subsidy system. The proposed reform would have paid Egyptian farmers global prices for their wheat in addition to a smaller direct subsidy that cut out intermediaries. Many experts said that would have ended the corruption seen last year and are worried the decision to drop the reform will lead to more problems. "They did not learn from last season," said Med Star for Trading's Soliman after the reversal was announced. Gad, once hopeful that his case would shed light on the wheat industry's endemic corruption, said he has lost hope. "The state has no will to deal with this issue," he said. "They're just going to keep doing the same thing because no one told them they were doing anything wrong. We're used to this. This is Egypt."