"All countries are paying attention to and taking measures to safeguard their own information security. This is beyond reproach," said China's Foreign Ministry spokesman Hua Chunying in a news briefing.
She made the statement after Obama criticized a proposed anti-terror law that he said could stifle U.S. tech business in China. The legislation would require companies to hand over encryption keys to the country's government, and create "back doors" into their systems to give the Chinese government surveillance access.
"This is something that I've raised directly with President Xi," Obama said in an interview with Reuters on Monday. "We have made it very clear to them that this is something they are going to have to change if they are to do business with the United States."
U.S. trade groups are also against another set of proposed regulations that would require vendors selling to China's telecommunication and banking sector to hand over sensitive intellectual property to the country's government.
Although China hasn't approved the proposed regulations, the country has made cybersecurity a national priority over the past year. This came after leaks from U.S. National Security Agency contractor Edward Snowden alleged that the U.S. had been secretly spying on Chinese companies and schools through cyber surveillance.
On Tuesday, China signaled that there was a clear need to protect the country from cyber espionage. Foreign Ministry spokeswoman Hua pointed to recent reports alleging that the U.S. and the U.K. had hacked into a SIM card maker for surveillance purposes as an example.
"I would like to point out that China has consistently opposed using one's superiority in information technology, or using IT products to support cyber surveillance," she said, adding that the anti-terror legislation relates to the country's domestic affairs.
China already imposes tough regulations on U.S. tech businesses through its strict online censorship that has blocked websites such as Facebook and Twitter. But last May, the country announced it was developing a new "cybersecurity vetting system" meant to weed out secret spying activities. Companies that failed to pass the vetting would be blocked from the market.