This won't work.
What to shield
Most of the cosmic radiation has quite low energies and can easily be shielded by the hull of an aircraft, spaceship or spacesuit. This would also be shielded by the atmosphere, but it would also burn/blow it away over time due to the intensity of the radiation. For luck, the magnetic field of the earth shields us from this radiation before it reaches the atmosphere.
And then there is the nasty stuff. Particles with energies which can easily punch through several centimeters of iron, lead or whatever. This stuff can not really be shielded by the magnetic field of the earth, nor could it be by artificial fields. Even worse, when this stuff hits a nucleus in the hull of a spaceship, it would smash it into many pieces, which will then fly along the direction of the original particle. Yes, this means radiation can be even higher behind a too thin shield! And since this happens in the hull or in the spaceship, one can't shield that by fields outside the ship.
In fact, most of the radiation in aviation is not made of the primary particles from space, but of secondary particles created in collisions between the primary particles and atoms of the atmosphere.
Field strength
The most important factor of field strength of a magnetic dipole is
$$B(r) \sim m/r^3$$
(Yes, to the power of three)
$m$ is the magnetic dipole strength, which for a simple conductor loop is given by current times area enclosed by the conductor.
So, if we build a coil of several thousand windings, resulting in a total current of several thousands of amperes, and an area of some ten squaremeters, we end up with an $m$ of several 10000Am². In contrast, earths magnetic field has about $8\cdot10^{22}$Am², which is a totally different order of magnitude.
Earths field strength might not be high - only about 40µT at the surface, but it reaches far, far into space. So, the time / distance the field acts on a particle is quite long, an can deflect it easily. In contrast, a human-made field will decrease to near zero within just a very few meters, and that's not enough.