On a boat it's an electrolytic reaction... galvanic reactions and electrolysis differ, so we might need to learn a little more about the situation...
If you anodize the metal it should become largely inert (although salt-water is capable of doing a lot.)