The data leaked from 32 million Ashley Madison accounts is embarrassing, sure, even devastating for the adulterers and wannabes who’ve registered with the site. But cheating, believe it or not, can bring you more than just shame in Illinois. You could also wind up in jail.

Illinois is one of 18 states, as of 2013, that have some sort of statute banning adultery. The text of this state's law, according to the Illinois Criminal Code, reads:

Sec. 11-35. Adultery.
(a) A person commits adultery when he or she has sexual intercourse with another not his or her spouse, if the behavior is open and notorious, and
(1) The person is married and knows the other person involved in such intercourse is not his spouse; or
(2) The person is not married and knows that the other person involved in such intercourse is married.
A person shall be exempt from prosecution under this Section if his liability is based solely on evidence he has given in order to comply with the requirements of Section 4-1.7 of "The Illinois Public Aid Code", approved April 11, 1967, as amended.
(b) Sentence.
Adultery is a Class A misdemeanor.

It's a crime punishable by up to a year in prison. And, as recently as 1997, the statute was actually used to charge a Harvey woman and her lover.

According to a Chicago Tribune article from the time, the woman’s husband came home to find her in bed with an auto mechanic. Because this was real life and not a porno, police said they were concerned that the husband might become violent. So they carted all three to the Harvey Police Department and charged the woman and the mechanic with a Class A misdemeanor, which is punishable by up to a year in prison. (Cook County prosecutors decided not to pursue the case.)

So how’d adultery become a crime here in the first place? The current statute entered the books in 1961, when the state revised its criminal code for the first time since 1874. But wait, you say. What about before the revision?

The first Illinois Criminal Code, passed in 1827, included this nugget:

Sec. 120. Any man and woman, who shall live together in an open state of adultery or fornication, or adultery and fornication, (which shall be sufficiently established by circumstances, which raise the presumption of cohabitation and unlawful intimacy;) every such man and woman shall be indicted severally, and on conviction shall be severally fined, not exceeding two hundred dollars, or imprisoned not exceeding six months; and for a second offence, they shall severally be punished twice as much as the former punishment; and for the third offence triple, and thus increasing the punishment for each succeeding offence…

That's six months in jail and $200 ($4121.27 in today's money) for a first-time offender. The revised codes of 1833 and 1845 have similar language.

And if you're wondering about that "open and notorious" language in today's law—and trying to figure out what "notorious" adultery is—check out the Illinois Supreme Court ruling on fornication in 1852. In ASA B. Searles v The People,  the court ruled that fornication laws apply when people “dwell together openly and notoriously, upon terms as if the conjugal relation existed between them. In other words, they must cohabit together. There must be an [sic] habitual illicit intercourse between them.”

In other words, lawmakers didn’t want people peacocking their infidelities around and corrupting everyone else. (Score one for American Puritanism.) Unsurprisingly, the law has only been enforced a handful of times and, other than the 1997 case, never in recent memory.

So why is it even still on the books? The New York Times explored this in 2012 and came away with a pretty simple answer: which state representative or senator would introduce a repeal bill, and how many people would actually want to vote on it?

Still, it’s unlikely that any local Ashley Madison users will don prison stripes in addition to their digital scarlet A. As former Northwestern University Law Professor Dan Polsby told the Tribune in 1997: "Imagine being the [assistant] state's attorney prosecuting fornication on the Near North Side of Chicago."