The Taliban takeover of Afghanistan has fueled a surge in the use of cryptocurrency as Afghans grasp for ways to cope with a deepening financial crisis, market analysts and local traders say, a trend that may offer hope for an ailing economy, but that poses concerns for Western security officials.

The appeal of cryptocurrency grew as Afghans saw it as a safe place for their funds and as digital-currency transactions continued in the wake of the Taliban’s seizure, while Western governments, banks and money-service businesses cut off access to other forms of finance, local traders say. The cryptocurrency option has provided a small but critical financial lifeline amid a cash crunch in an economy racked by political crisis.

But if the Taliban were to adopt cryptocurrency as part of a national economic policy, it could aid efforts to circumvent some Western sanctions and other leverage against the country’s new rulers, say some former U.S. officials and security experts.

The Taliban-dominated government now running Afghanistan has yet to take a position on the use of digital currencies and didn’t respond to a request for comment.

The rise in cryptocurrency usage over the past several months catapulted Afghanistan into the top 20 of the 154 countries ranked in the 2021 Global Crypto Adoption Index, published by crypto analytics firm Chainalysis in August. The country—which this year joined the U.S., China and Russia in the top 20—ranked among the lowest last year. The firm ranks countries by the growth in volume of crypto trading, adjusting for the population’s purchasing power.

Bitcoin traders in Afghanistan say its use surged as the U.S. planned its exit from the country and as the Taliban’s territorial gains raised the possibility of Kabul’s seizure, with Afghans transferring their savings into an asset believed to be more secure than local currency and bank accounts.

“It’s a little easier for many of those people to download an app that ties to exchanges like Binance where they can then purchase crypto assets,” said Amit Sharma, a former senior U.S. Treasury official and founder of FinClusive, a digital financial-services company.

In late July and early August, as the Taliban’s takeover of the nation’s capital grew increasingly likely, the country’s central bank pulled hard currency reserves from its vaults, the U.S. halted shipments of widely used dollar bills, and banks imposed capital controls.

Taliban soldiers standing guard in Afghanistan’s Panjshir province.

Photo: Mohammad Asif Khan/Associated Press

A subsequent devaluation of the Afghani, the country’s official currency, accelerated after Kabul’s seizure as Western financial institutions froze cross-border transactions, foreign assistance dried up, banks closed and government officials, including its central bank governor, fled the country.

Even informal money-service businesses, called hawalas, and money-exchange houses that collectively are estimated to store hundreds of millions of dollars of hard currencies faced disruptions, say local traders and a former U.S. Treasury official familiar with the matter.

But locally operated bitcoin exchanges kept operating, say local traders, allowing family members abroad to send money to those back home. Those transactions provided digital currency that was then exchanged for hard currency to use to buy dwindling supplies of food and other daily commodities.

“Bitcoin will solve our problems,” said Safi Zarinagha, who runs a digital-currency business in Kabul. “It is really easy to exchange and to send money from one place to another.”

Terror sanctions against the Taliban are expected to continue to clog conventional financing, both from the private sector and from sources of international assistance, say current and former Western officials.

But the ability of crypto platforms to make large-value transactions without banks could help unclog those critical cross-border money flows, say bitcoin advocates and local traders.

Cryptocurrency miners in China are turning off their machines after Beijing warned it would tighten its control over the industry. This has created an opportunity for miners elsewhere, as the power behind crypto becomes less dependent on one place. Photo illustration: Sharon Shi The Wall Street Journal Interactive Edition

“It hasn’t caught on that much by the hawaladars, but there are some young, tech-savvy guys who are using bitcoins as a form of hawala,” said another Afghan trader. “It’s censorship-resistant and highly efficient,” the trader said.

For a country heavily reliant on remittances from family members abroad and international aid, crypto could prove a critical lifeline for the ailing economy.

Some supporters of the Taliban, such as an Afghan-American woman who said she uses the pseudonym “Bibi Janey” on Twitter, say the ability to send anonymous bitcoin transactions and avoid the Western financial system makes it a perfect financial tool for Kabul’s new rulers.

“I’d like to suggest to the Taliban senior leadership to hold an emergency meeting with money exchangers (sarafis) to train them on exchanging bitcoin,” she wrote on Twitter four days after the group seized power in Kabul.

More than half of the seven million Afghan expatriates estimated by the United Nations to have resettled abroad live in nations where bitcoin use is becoming more widespread, including Iran, where some crypto analysts say the industry is being used to evade sweeping U.S. sanctions.

Mr. Sharma, the former senior U.S. Treasury official, said that as more Afghans get access to smartphones and even flip phones, crypto can enable not just remittances, but also domestic and international trade. While hawalas and local hard-currency exchanges may take time to adopt crypto, digital finance is becoming more widespread in neighboring countries such as Pakistan, Iran and the United Arab Emirates, he said.

The growth of digital currency and the anonymity offered by some platforms have drawn other U.S.-designated terror groups and international cartels, and could make cryptocurrency inviting for the Taliban as well, the Middle East Media Research Institute, a Washington-based nonprofit, has said.

“The Taliban might look to cryptocurrency if U.S. sanctions do move forward and Afghanistan remains cut off from international finance,” said Richard Goldberg, a former senior National Security Council official in the Trump administration now at the Washington-based Foundation for Defense of Democracies.

Write to Ian Talley at ian.talley@wsj.com