Beijing has for a long time accused the U.S. of carrying out cyberattacks on Chinese targets. But more recently, it has accused the U.S.'s National Security Agency of hacking specific targets.

According to a report published Tuesday, China accused a top U.S. spy agency of stealing Chinese user data andinfiltrating the country's telecommunications infrastructure.

Last week, Chinese state media reported on an alleged attack by the U.S. National Security Agency on a Chinese university.

Specific ways in which the alleged attack was carried out were laid out in the report.

There is tension between the US and China in the cyber sphere. Washington has been accused of carrying out cyberattacks by Beijing for a long time. The approach from China has changed.

According to a report published in the People's Daily newspaper, the National Security Agency started with a man-in-the-middle attack. A hacker eavesdrops on digital communication between two people. According to the report, the U.S. agency was able to get into the university's network by getting the credentials of employees.

The report claims that the National Security Agency was able to get further access to sensitive data when it was in the network.

According to the report, the data of people in China with "sensitive identities" was given to the agency's headquarters in the U.S.

When contacted by CNBC, the National Security Agency was silent.

There are a number of reasons why the attack is being blamed on the National Security Agency.

16 of the hacking tools used were identical to ones dumped online by a group called the Shadow Brokers, which were able to get access to the techniques and methods of the National Security Agency. The report claims that the National Security Agency carried out attacks on the US during working hours and on public holidays.

According to the report, the attackers used American English, the devices associated with the hackers had an English-language operating system, and they used an American keyboard for input.

There are disagreements in the technology and cyber arena between the U.S. and China over the activities of the National Security Agency. Over the last few years, there has been increased competition between the two largest economies in the world.

The U.S. has accused China of large-scale hacking. Christopher Wray, the director of the Federal Bureau of Investigation, said in February that China's cyberattacks have become more damaging than before.

China was accused of attempting to steal information and technology.