Bluing is a passivation process in which steel is partially protected against rust, and is named after the blue-black appearance of the resulting protective finish. True gun bluing is an electrochemical conversion coating resulting from an oxidizing chemical reaction with iron on the surface selectively forming magnetite (Fe3O4), the black oxide of iron. Black oxide provides minimal protection against corrosion, unless also treated with a water-displacing oil to reduce wetting and galvanic action. A distinction can be made between traditional bluing and some other more modern black oxide coatings, although bluing is a subset of black oxide coatings.
In comparison, rust, the red oxide of iron (Fe2O3), undergoes an extremely large volume change upon hydration; as a result, the oxide easily flakes off causing the typical reddish rusting away of iron. "Cold", "Hot", "Rust Blue" and "Fume Blue" are oxidizing processes simply referred to as bluing.
"Cold" bluing is generally a selenium dioxide based compound that colors steel black, or more often a very dark gray. It is a difficult product to apply evenly, offers minimal protection and is generally best used for small fast repair jobs and touch-ups.
Link to full details
Bluing (steel) - Wikipedia, the free encyclopedia