In 1962 the United States conducted a test of a nuclear weapon in space: en.wikipedia.org/… . This was publically announced, as the explosion was to be visible from Hawaii. People took their picnic baskets and blankets to the beaches to watch the fireworks display. Full color spreads were featured in Look and Life, two large format picture magazines of the day. The Starfish Prime test also degraded or disabled every satellite then in orbit. The electrical power grid of Hawaii was knocked out by the Electro-Magnetic Pulse (EMP) from the weapon detonation. Subsequent tests in the Starfish series were deemed unnecessary, as all test objectives were achieved by the first trial.
[Full disclosure: I hold a PhD in Physics and Astronomy, and until my retirement several years ago, held a secret clearance. However, all information in this article are from public sources, and I never had access to any classified information on this topic.]
When a nuclear weapon explodes in vacuum, there is no appreciable shock wave. The only mass nearby to form a shock is the vaporized bomb casing itself. So the charged particle radiation, and the electromagnetic radiation (e.g. light) spread out unhindered. [It is unfortunate that in English we use the same word: radiation to describe two very different physical effects.] The charged particle radiation is captured by the Earth’s magnetic field, and the EMP spreads out along lines of sight.
Charged particle radiation can destroy electronics, which probably explains the satellite failures after the Starfish test. On Hawaii, the long power lines of the electric grid acted as antennas, converting the EMP pulse into a voltage surge that destroyed many electric transformers.
Mother Nature does this too, just not recently. In September 1859 a major solar flare, now called the Carrington Event: en.wikipedia.org/… caused notable world wide auroras. The new telegraph system’s long wires again acted as antennas, and the voltage surge destroyed much equipment in telegraph offices across the US. The US physics community has repeatedly urged the hardening of the US power grid and electronics against this type of natural EMP event, but so far nothing has been done.
In the recent past (1980-1990s) former vice president Dick Cheney warned of a North Korean nuclear ‘Pearl Harbor’, where they would lob one of their nuclear weapons up into space, using an undependable rocket, and detonate it there. The damage from EMP and artificial radiation belts could be very significant, without actually killing anyone on the ground. As reported by Aviation Week and other popular/technical publications, the US has devoted significant resources to hardening US military satellites to both EMP and charged particle radiation. Cheney urged civilian satellite operators to follow suit, but apparently that has not been done.
The danger from nuclear explosions in space, including natural solar flares, is real. It is one unfortunate fact that politicians do not get credit for avoiding problems, only for solving them. [Reference climate change.] Its not yet time to wrap your PC and cell phone in aluminum foil [physics jargon for that is a Faraday Cage, and it would keep out EM pulses. ] But there is a use for tin foil.