Treasury Secretary Jack Lew called bitcoin a "phenomenon," but told CNBC on Thursday that the U.S. government needs to make sure the digital currency doesn't become a funding haven for criminals and terrorists. In an interview at the World Economic Forum in Davos, Switzerland, Lew told "Squawk Box" he has spoken to JPMorgan Chairman and CEO Jamie Dimon about bitcoin, and the two share a certain "incredulity" about it. (Read more: Dimon: Economy starting to fire on all cylinders) "From the government's perspective, we have to make sure [bitcoin] does not become avenue to funding illegal activities or to funding activities that have malign purposes like terrorist activities," Lew said. "It is an anonymous form of transaction. And it offers places for people to hide." (Read more: Treasury launches new security—first in 17 years)

Jack Lew at 2014 WEF in Davos, Switzerland. Patrick Bucci | CNBC

In a separate interview, Dimon told CNBC Wednesday that JPMorgan would be unlikely to have much to do with bitcoin.

"The question isn't whether we accept it. The question is do we even participate [with] people who facilitate bitcoin?" he said. "The people who are going to eventually really get upset with it will be governments." Bitcoin will eventually be made to follow the same standards as all other payment systems, Dimon predicted. "That will probably be the end of them." Lew said the government has made it clear through enforcement actions that it will look at bitcoin and similar transactions and will "enforce all the rules on illegal money activity."