When it can be illegal to withdraw your own money

Ex-US Speaker Hastert indicted
Ex-US Speaker Hastert indicted   

It's your money, in your account, but that doesn't mean you can take it out any way you please.

Failure to report large cash transactions can often trigger federal investigations, leading to fines or even lengthy prison sentences.

It all stems from U.S. law that requires forms to be submitted—both by financial institutions, as well as bank customers—each time a cash transaction in excess of $10,000 occurs. Customers hoping to avoid having to disclose such transactions often seek ways around around the law in a process known as "structuring," which can lead to serious money laundering charges.

Read More What do Toyota and Madoff have in common?

Federal prosecutors charged former GOP House Speaker Dennis Hastert with structuring on Thursday after he allegedly withdrew over $3 million from 2010 to 2014, according to the indictment. The former Illinois Republican claims he was keeping the cash he withdrew, but the indictment shows the FBI believes Hastert lied about making cash payments to an individual he committed "prior misconduct" against.

"You can't lie in those situations," says Jeffery Robinson, author of "The Laundrymen," a book about money laundering. "If he had come clean in the beginning, they would have slapped him on the wrist. Now he could be guilty for money laundering and could face twenty years."

Read MorePolice cash confiscations still on the rise

Hastert is accused of withdrawing nearly $1 million in small transactions over the course of nearly five years.

Why is structuring illegal?

Customers can avoid banks automatically filing currency transaction reports, or CTRs, by deliberately withdrawing cash amounts close to but below the $10,000 mark. But the process of structuring these transactions that are just below $10,000 can appear suspicious to both banks and federal authorities, like the Treasury's Financial Crimes Enforcement Network. The process becomes a crime in and of itself once a customer either lies about his or her reasons for the transactions or federal authorities uncover the intent behind them.

"Structuring is one of the key components of money laundering," says Robinson. "It often has to do with disguising cash so it cannot be associated with the underlying crime."

Read MoreHow a mother-daughter duo built a $15 million con

Banks, which are often forced to over-report to protect themselves, also can also choose to report transactions that they deem suspicious, or any cases of transactions totaling $10,000 annually.

Convictions on structuring charges can carry five years of prison time or fines up to triple the amount withdrawn, under the Racketeer Influence and Corrupt Organizations Act.