Attorney General Eric Holder told lawmakers that Bitcoin and other virtual currencies pose a challenge for law enforcement agencies, because they can be used to "conceal illegal activity."

Holder, testifying before the House Judiciary Committee on Tuesday, said the Justice Department is working with financial regulators to figure out how to deal with bad actors who use digital currencies to buy drugs, weapons and other illegal goods and services.

"Those who favor virtual currencies solely for their ability to help mask drug trafficking or other illicit conduct should think twice," Holder said.

Bitcoin has been in turmoil in recent months. The FBI has raised concerns about the use of virtual currencies in illegal marketplaces. One of the major Bitcoin exchanges, Mt.Gox, collapsed. And the IRS took a first step towards regulating Bitcoin by declaring it would treat the virtual currency as a taxable property.

Holder told lawmakers that the Justice Department is "committed to innovating alongside this new technology in order to ensure our investigations are not impeded by any improvement in criminals' ability to move funds anonymously."