The weapon is called a railgun and requires neither gunpowder nor explosive. It is powered by electromagnetic rails that accelerate a hardened projectile to staggering velocity. The railgun projectile instead gains speed as it travels the length of a 32-foot barrel, exiting the muzzle at 4,500 miles an hour, or more than a mile a second. The railgun has a range of 125 miles. “This is going to change the way we fight,” said U.S. Navy Adm. Mat Winter, the head of the Office of Naval Research. The railgun’s prospective military advantage has made the developing technology a priority of hackers in China and Russia, officials said. Chinese hackers in particular have tried to penetrate the computer systems of the Pentagon and its defense contractors to probe railgun secrets, U.S. defense officials said. Defense planners believe the U.S. needs new military advances. Russia, for example, is believed to be developing longer-range surface-to-air missiles and new electronic warfare technology to blunt any forces near its borders. Prospects for an armed conflict among the great powers still seem remote. But for the first time since the end of the Cold War, the Pentagon is again looking closely at responses to rising tensions with China and Russia. Military planners say the railgun would be useful if the U.S. had to defend the Baltic states against Russia, or support an ally against China in the South China Sea.