Yahoo has announced it will encrypt all user information that moves between its data centres by the end of March 2014.
The internet provider said it had taken this step after allegations the US government had secretly accessed users' data without the company's knowledge.
In October the Washington Post obtained documents from former National Security Agency contractor Edward Snowden.
They alleged the agency had broken in to the main communication links that connect Yahoo's data centres.
The company had already revealed plans to encrypt email communications from January 2014 after previous allegations of government agencies accessing email traffic.
In a statement released on the company's Tumblr account on Monday, chief executive Marissa Mayer said: "I want to reiterate what we have said in the past - Yahoo has never given access to our data centres to the NSA or to any other government agency. Ever.
"There is nothing more important to us than protecting our users' privacy."
Users will also be given the option to encrypt communications between themselves and Yahoo.
Mark Manulis, associate professor of applied cryptography and network security at the University of Surrey, told the BBC: "We'll see more of this.
"[Yahoo] is moving along with other companies in this direction. This is better than no encryption but is it enough?"
"It makes it harder for the average hacker, but it still could be possible for government agencies [to access] depending on what encryption is used," he said.
Google already encrypts its email service and has been speeding up the implementation of its encryption between data centres since June.
According to the documents leaked by Mr Snowden, the NSA's programme for accessing companies' data links is known as Muscular and is operated jointly with UK spy agency GCHQ.
The documents indicate Yahoo and Google had been targeted in this way.
More than 181 million records were processed in the month prior to January 2013, according to the Washington Post.
A separate programme known as Prism, also run by the NSA, reportedly allows the agency to access users' emails and a range of other data with the permission of a court order.
The NSA has requested access to information from Microsoft and its Skype division, Google and its YouTube division, Yahoo, Facebook, AOL and Apple, according to a leaked presentation from April 2013.