Aqueous p-toluenesulfonic acid solution is used to electrosynthesize a polyaniline (PANi) film on mild steel. Polarization of the substrate in this medium leads to passivation of the surface mainly via the formation of an iron oxide layer. When aniline is added to the solution, electropolymerization is not hindered and a dark green deposit is obtained in high yield (80%). Spectrochemical techniques (IR, XPS and UV) and mass determination (SEC and MALDI) indicate that it has the same properties as reported for PANi. Evaluation of the anticorrosion performances of the film shows that the corrosion current is divided nearly by ten, suggesting that this polymer coating could be used for corrosion protection.