Canada said it is talking to Saudi Arabia and the UAE to resolve a fight over BlackBerry security that could jeopardize the growth of Research in Motion Ltd, the country's most important tech exporter.

Saudi Arabia said it would ban the BlackBerry Messenger function on Friday if it and RIM do not reach an agreement, though a source with direct knowledge of talks between RIM and the government said they had made progress.

RIM is facing increased pressure to open its smartphones to government scrutiny. Lebanon and India, in addition to Saudi Arabia and the United Arab Emirates, have raised national security concerns over encrypted BlackBerry user data and are demanding access to it.

U.S. Secretary of State Hillary Clinton, who has promoted Internet freedom as a basic human right, said the United States will hold talks with the UAE and other countries on the issue.

Canada is concerned about the looming ban and its broader implications, Trade Minister Peter Van Loan said in a statement. He said Canadian officials were working with RIM, Saudi Arabia and the UAE to find a solution.

Canada has been working closely with the officials at Research In Motion as well as with governments on the ground to assist them in dealing with these challenges, the minister told reporters in Ottawa.

Shares of RIM fell about 2 percent Thursday on the Nasdaq and Toronto stock exchanges. The stock has lost about 9 percent of its value since the UAE threatened over the weekend to ban BlackBerry email, messaging and Internet services after three years of negotiations with RIM over access to user data.

RIM is in an unusual position of having to deal with government requests to monitor its clients because it is the only smartphone maker that manages the traffic of messages sent using its equipment.

Although the Gulf region accounts for only a small portion of RIM's more than 41 million subscribers, analysts said they were concerned about the impact on the Canadian company's reputation for providing iron-clad smartphone services.

The company has to stand its ground...they've built their loyalty largely around security, said Nick Agostino, analyst at Mackie Research Capital Corp.

RIM has said its technology will not allow a third party to monitor communications running through the BlackBerry's enterprise servers. Co-CEO Michael Lazaridis, in an interview with the Wall Street Journal, accused governments of picking on smartphones to score political points.

This is about the Internet, Lazaridis was quoted as saying. Everything on the Internet is encrypted. This is not a BlackBerry-only issue. If they can't deal with the Internet, they should shut it off.

Governments from China to Iran have become more vocal about controlling conversations on the Internet and on mobile phones, citing risks to national security.

Disputes between government regulators and technology providers have escalated into diplomatic disputes, such as the one between China and Google Inc over Internet censorship and cyber attacks earlier this year.

Clinton, who had also waded into the Google-China dispute, said on Thursday about the BlackBerry issue: We are taking time to consult and analyze the full array of interests and issues at stake because we know that there is a legitimate security concern, but there is also a legitimate right of free use and access.

Some analysts said it may be difficult for governments to get what they want.

I think their expectations are unrealistic over the long term to maintain the kind of control that they're looking for. They're really trying to put the genie back in the bottle here, said Kevin Restivo, a senior mobile phone analyst at IDC.

Lebanon said on Thursday it was studying security concerns related to the BlackBerry and would begin talks with RIM.

Media reports had said that Indonesia was pressing on RIM to allow monitoring of BlackBerry data, though the country's communications minister said it was not banning the service.

India, worried that BlackBerry's secure messaging services could be misused by militants, has demanded more access for its security agencies, and the country's telecoms minister said it had not reached an agreement with the company.

India has made these threats time and again and India's starting to sound like the boy that cried wolf, a little bit, because RIM continues to maintain service there and has talked to the government many times and come to resolutions over the course of time, said Restivo.

RIM has said BlackBerry security is based on a system where customers create their own keys. The company neither has a master key nor any back door to let RIM or third parties to gain access to data.

But one security expert said the RIM system was not impregnable. I could design a good hundred ways to gain access, said Bruce Schneier, chief security technology officer for BT.

The company said Wednesday it has never provided anything unique to the government of one country and cannot accommodate any request for a copy of a customer's encryption key. (Additional reporting by Souhail Karam, Emma Ashburn and Jeffrey Hodgson; Writing by Ritsuko Ando in New York and Frank McGurty in Toronto; Editing by Dave Zimmerman, Robert MacMillan and Tim Dobbyn)