Ag/polyaniline(Ag/PANI) nanocomposite was successfully prepared by in-situ polymerization of aniline from nano-silver colloid solution using aniline as dispersant. FT-IR, XRD, SEM, TEM and electrochemical analyzer were used to characterize and analyze Ag/PANI nanocomposite. The results show that the core-shell structure with silver nanoparticles as core and polyaniline as shell was formed. The smallest size of spherical-like composite particles can be less than 100 nm. Compared with PANI, the electrochemical activity and specific capacity of the prepared Ag/PANI nanocomposite are greatly improved due to Ag nano-particle. The corrosion current density of the Ag/PANI nanocomposite is 72.1 μA/cm2, while the corrosion current density of PANI is 106 μA/cm2. Compared to PANI, the corrosion current density of the Ag/PANI nanocomposite decreases by 33.9 μA/cm2. The corrosion resistance of Ag/PANI nanocomposites is significantly improved.