Chemical castration is more humane than actual castration. Additionally, it is not permanent.
Depo-Provera is the drug used today. It "acts on the brain to inhibit hormones that stimulate the testicles to produce testosterone"
External links ACLU article on chemical castration