The following editorial appeared recently in the Chicago Tribune:

If you want to access your email, withdraw cash from a machine or use a credit card online, you have to enter some information to confirm that you are who you claim to be — a password, a PIN number, a security code. No one objects to these safeguards, provided they don't actually keep us from doing things we are entitled to do. Convenience and security can both be served, and they usually are.

The same goals ought to be paramount in the realm of voting. Many states have passed laws requiring voters to produce photo identification when they show up at the polls, to prevent ballot fraud — say, someone claiming to be John Smith showing up to vote even though John Smith recently passed away. The old joke, "When I die, bury me in Chicago so I can stay active in politics," is based on sleazy practices once common in Cook County (and elsewhere too).

But opponents think the goal is less to clean up elections than to disenfranchise certain voters. The new laws are a favorite cause of Republicans, who stand to gain if voters without such IDs — who tend to be poor or members of minority groups — are not allowed to vote. The charge gains credence because these measures sometimes accompany changes that limit early voting hours or restrict voter registration efforts.

Both sides in the photo ID battle have valid concerns. For Republicans, it's safeguarding the fundamental integrity of elections; for Democrats, it's maximizing citizen participation in democracy. It's not impossible to uphold both purposes. And the good news is that the courts are acting to do just that.

The most recent instance came in Pennsylvania, where a state judge upheld a new law with a strict photo ID requirement — while blocking it for the November election because the state has not done enough to assure easy access to state-issued cards. Earlier, a federal court struck down a similar mandate in Texas, partly because some citizens would have to drive 200 miles or more to comply with the law.

But a photo ID rule can be done right. In 2008, the U.S. Supreme Court approved Indiana's system, which provided free IDs and allowed those citizens who don't have them to cast provisional ballots.

Critics say the laws are a solution in search of a problem because voter fraud is rare and unlikely to affect the outcome of any election. But weak ID laws are an invitation to cheating, and the best time to close an avenue to such behavior is before it happens, not after.

Tougher laws, however, should weigh the likely gain against the potential harm, namely preventing honest citizens from casting ballots. That's a real danger that sensible legislators should take great care to eliminate.

The electoral impact shouldn't be exaggerated, though. Nate Cohn, who analyzes election data for The New Republic magazine, says Indiana and Georgia were the first states to impose such a requirement, before the 2008 election. "If voter identification requirements suppressed Democratic turnout in Georgia or Indiana," he writes, "the effects were not readily observable in the final results."

It may be that voter fraud and voting restrictions don't actually affect who gets elected. But we all have a stake in preventing voter fraud and we all have a stake in facilitating citizen participation in democracy. Our lawmakers have a duty not to shortchange either.