When U.S. customs officials detained grocery store owner Stew Leonard as he boarded a flight to the Caribbean, they found $20,000 cash on him and another $50,000 in his luggage. Leonard, whose grocery store chain is a Connecticut icon, had acquired the money through a decade-long tax scam and was in the process of smuggling it to his second home on St. Martin. By 1993, Leonard had pleaded guilty to his role in a plot to conceal $17 million in sales made at his stores, resulting in $6.8 million in unpaid federal taxes.

The scam was notable for its sophisticated use of computer software to alter sales records. But state and local leaders say that Leonard's scam wasn't an isolated incident, and they're trying to figure out how to attack devices known as "zappers" that help retailers and restaurateurs cheat the tax man.

The scam has advanced from Leonard's time, when his associates hid the software in a hollowed-out copy of the 1982-1983 New England Business Directory. Today, the zapper software is stored on a portable USB device that can be linked to the cash register system. At the end of the day, the software systematically modifies the machine's records to reduce the value of the day's sales. On one receipt, a $5 cheeseburger may become a $4.50 hamburger, for example, or a $2 soda may be erased. For every dollar in sales a restaurant deletes from its records, the owner gets to keep an extra 5 to 9 cents that would otherwise be sent to a state and local government as sales tax. Done enough times, the pennies add up. Owners are also likely to avoid state and federal income taxes on the unreported sales.

"This is something that's in the restaurant trade in spades," says Richard Ainsworth, a tax attorney and Boston University School of Law professor who has researched zappers extensively. "It's infecting the system."

Zappers, which overwrite original records, create nightmares for auditors, and especially crafty versions can tweak inventory records and other financial reports to help owners cover their tracks. The software can even be used remotely, so the proprietor of a business doesn't need to be onsite to work the scam. The devices only work with cash transactions, since debit and credit cards leave a paper trail, and they are most commonly used at cash-heavy businesses such as restaurants and convenience stores.

The technology is a twist on old tax scams in which business owners might maintain two registers but only report the sales for one. Ainsworth says the devices work so well that a proprietor's biggest challenge might be what to do with all the extra cash. Zappers have been detected worldwide, including Australia, Brazil, Canada and several European countries.

It's difficult, however, to quantify just how pervasive the problem is in the U.S. This month, a new Canada Revenue Agency report revealed that over a three-year period, one third of the 424 restaurants audited have tried to reduce their tax bills by manipulating electronic cash register data. Collectively, they erased $141 million in sales, or about $1 million per restaurant. Quebec's tax authority estimates that in the 2007-2008 fiscal year, it lost $417 million in tax revenue from tax fraud in the restaurant sector. The province has prosecuted at least 230 zapper cases, and is advising customers to pay with checks and credit cards to create a paper trail that makes fraud more difficult.

But comprehensive studies haven't been conducted in the U.S. "The concern is how big is it," says Joe Huddleston, executive director of the Multistate Tax Commission, an intergovernmental state tax agency that works with members on income and sales tax audits. "It's very difficult for us to make that calculation."

Historically, the issue has gotten scant attention in the U.S., although that may be starting to change. This month, Ainsworth delivered a presentation in San Antonio to state legislators from across the country in which he explained the zapper problem, which he thinks is costing states billions of dollars in lost revenue annually. Those losses are especially painful now, when states are still reeling from lower tax collections in the wake of the recession. His pitch to states: If they can beat zappers, they can get more revenue without having to raise taxes.

It's worth noting that zappers don't actually save customers the cost of the sales tax. They still pay it -- the money just goes to business owners instead of to the government. "This is money that you and I are paying to the state that's not getting there," Ainsworth says. "If you want this money, you don't have to increase taxes or expand the base. You just have to do a little bit of enforcement."

That message seems to be resonating. Next month, the IRS will run a training program in Boston to help increase auditors' knowledge of zappers, Ainsworth said, adding that it will be the agency's first training session on the subject.

Earlier this year, Georgia passed a law that provides stiff penalties for those caught selling, installing or even just possessing devices (Ainsworth estimates zappers cost Georgia $372 million annually in lost revenue). A similar measure has been introduced in the New York Legislature, which is also considering whether to conduct a study to determine the extent of the zapper problem. New York state Sen. Liz Krueger, who sponsored the legislation, says she became aware of the issue when someone mentioned it during a roundtable she convened while chairing a subcommittee on tax and budget reform. She and her staff used Google Translate to copy parts of Quebec's statute, written in French, into her bill. Her plan also calls for amnesty for zapper users who agree to pay back taxes.

The New York Post, citing unnamed sources, reported that the Department of Taxation and Finance has conducted at least four stings in which undercover operatives posed as new restaurateurs seeking equipment. Most cash register salesmen they encountered mentioned that they could help the proprietors evade taxes.

Georgia State Sen. Don Balfour, who sponsored the zapper legislation in his state, says the restaurant industry didn't fight the proposal. Law-abiding establishments have an interest in supporting efforts to combat zappers because a crackdown would eliminate the competitive advantage enjoyed by those who avoid paying taxes. The Canadian Restaurant and Foodservices Association has pledged to work with the government to root out zapping. The National Restaurant Association (NRA), however, doesn't have a position on the issue just yet. Sue Hensley, senior vice president for public affairs at the NRA, which represents 380,000 American restaurants, says they just aren't familiar with zappers. That was also true of most of the state lawmakers attending the San Antonio presentation.

But state tax auditors are actually more knowledgeable of the situation than suggested, says Verenda Smith, a senior manager at the Federation of Tax Administrators. "We don't sit around and put out news releases on it," Smith says. "But people involved with it have been [aware] for quite some time." (Ainsworth, it's worth noting, works for ADP, which could potentially get contracts from state governments seeking tools to fight zappers).

One obstacle to fighting zappers is the limited resources of auditors. State budgets have suffered serious cuts over the last four years, and tax offices haven't been immune. But even during good times, auditors tend to focus on larger companies with larger tax liabilities. Small- to medium-sized operations dealing with cash often can't provide the return that auditors need to justify their intervention.

Still, while it's difficult for auditors to identify zappers, it's not impossible. Computer-altered records may have telltale signs and symbols that signal possible tampering. Software can help auditors identify these signs of fraud. Auditors know the kinds of profit margins businesses should have and may notice discrepancies if zappers are being used. If copies of sales reports are printed out before the zapping occurs, they may provide clear evidence of wrongdoing.

Other countries are starting to develop preventative solutions to stop businesses from using zappers. In Greece, all cash registers must be certified as tamper-proof before being sold. In Germany, a tamper-proof device that records sales data is essentially welded into registers. Auditors can access that data when they arrive onsite. Belgium, Sweden and the Philippines are considering similar devices that would even allow auditors to gain remote access to register data in some circumstances, Ainsworth says.

Though Ainsworth hopes the U.S. will take action to beat the scam, he's not particularly optimistic. "I'm sort of tired of this zapper stuff," says Ainsworth, who appears to be the only American academic researching the subject. "Nobody's going to listen."

Meanwhile, New York state Sen. Krueger's legislation has stalled, even though she believes it's the kind of policy that should generate bipartisan support since it merely helps the state enforce existing tax laws. "I sort of think this bill is a no-brainer," Krueger says.