KABUL, Afhanistan — Off a dusty, unpaved street near Kabul University, Roya Mahboob’s software company is designing a Web platform to let Afghan women create content from home even if Taliban militants return to power and curb their rights.

“I just make myself more invisible in the society” while “becoming more visible” on the Internet, Mahboob, 26, a computer science graduate of Herat University, said of her tactic for coping with opposition in a country that faces potential upheaval after international combat troops leave at the end of this year.

Retreating behind the electronic veil of the Internet isn’t an option for Zarghuna Sherzad, 46, a partner in Jahan Guldozi, an embroidery factory that employs 20 women about three miles from Mahboob’s office in Kabul.

“I grew up in the war, and I’ve spent a very difficult time in the past,” she said through an interpreter at her factory, recalling that when the Taliban ruled Afghanistan before the U.S. invasion in 2001, she endured beatings just for wearing sandals that showed her feet. “I’m always praying that regime should not be repeated.”

Women such as Mahboob and Sherzad are at risk of losing the freedoms they’ve won since the United States and its allies upended the Taliban, who cited their fundamentalist interpretation of the Koran to ban girls from attending schools and women from leaving their homes. Those gains already are under stress as international combat forces prepare to leave by the end of this year.

Afghan women have gained legal rights and protections in the last decade. Women are now 27 percent of the country’s parliament and have started to join police forces. A decree signed by President Hamid Karzai in 2009 made rape a crime for the first time, while also banning violence against women, child marriage, forced marriage and the denial of rights to education or work.

Those gains are tentative, the International Crisis Group said in an October report, “Women and Conflict in Afghanistan.” The decree signed by Karzai has yet to be ratified by the Parliament, where conservative lawmakers have called it un-Islamic, the group said. The country’s new electoral law calls for reducing a quota for female parliamentarians to 20 percent from 25 percent.

Since Afghan National Security Forces took the lead role from U.S. and other foreign forces in the middle of last year, “insurgent threats to women have increased,” according to the Brussels-based group. Women’s rights “are also under attack from yesterday’s warlords, now power brokers both within and outside government.”

While some of the candidates for president have affirmed their support for women’s rights, the Taliban say that if they return to rule or share power they will bar women from wearing Western clothes and girls from sharing classrooms with boys.

Women in public roles increasingly have come under attack. On Jan. 2, two gunmen on a motorbike in the western Afghan city of Herat shot to death Yalda Waziri, 25, who worked for the local government, according to the BBC. In the same province, Lt. Negar, 38 a female police official who like many Afghans went by one name, was shot and killed in September, a few months after her female predecessor was killed in a similar fashion, the BBC reported.

“There are real fears of losing the progress that has been made,” said Afshan Khan, chief executive officer of Women for Women International, a Washington-based nonprofit group that helps women in war-torn countries rebuild their lives.

In the last decade, Women for Women has trained 46,000 Afghan women, providing them with skills to operate small businesses. The group also has distributed $26 million in stipends and micro-credits, Khan said.

Sherzad, who had no schooling and raised two daughters after her husband disappeared, graduated from Women for Women’s one-year training program. She teamed up two years ago with Nesar Ahmad to expand the embroidery business he operated.

Together, they’ve invested $250,000 in computerized Chinese machines that make decorative embroidered panels.

In addition to the 20 workers at the factory, the company employs 300 women who work from their homes, Sherzad said. .

In a country where conservative Islamic groups still forbid mixing genders, the partnership between Ahmad, 50, and Sherzad stands out all the more because they belong to tribes that traditionally have clashed. She’s a Pashtun, a Sunni majority group from the south that includes the Taliban, and he’s a Hazara, a predominantly Shiite minority group from the north.

Sherzad’s family, including her missing husband’s brother and other Pashtun men, were against the partnership.

Ahmad said he prevailed by telling Sherzad’s brother-in-law: “If you’re feeling so protective about her, why don’t you provide food for her and her two daughters? If you can, that’s OK. But if you’re not, then she should be able to work.”

Amid uncertainty over a presidential election scheduled for April and the departure of most foreign troops by year-end, “There’s a fear if Taliban return to power, we’ll lose all the progress we’ve made,” Ahmad said.

In contrast, a select group of Afghan girls and women who’ve grown up in the last decade, gone to school and are familiar with computers may find online sanctuary if Mahboob’s initiative succeeds.

Mahboob, whose Afghan Citadel Software Co. was started with the help of the Defense Department’s Task Force for Business and Stability Operations, has developed a blogging and film platform called Women’s Annex.

It lets women work from their homes to produce content that’s then featured on social-media websites. Advertising revenue generated by the sites is shared with the content creators, Mahboob said.

She was named one of Time magazine’s 100 most influential people in the world last year because of her role as a female entrepreneur working to expand Internet access for women.

“Even if the Taliban are back, women can get online education …. If fighting starts, then I don’t know if the Internet will be available,” she said.