We use the replica method to study the ideal glass transition of a liquid of identical hard spheres. We obtain estimates of the configurational entropy in the liquid phase, of the Kauzmann packing fraction phi(K), in the range of 0.58-0.62, and of the random close packing density phi(c), in the range of 0.64-0.67, depending on the approximation we use for the equation of state of the liquid. We also compute the pair-correlation function in the glassy states (i.e., dense amorphous packings) and we find that the mean coordination number at phi(c) is equal to 6. All these results compare well with numerical simulations and with other existing theories.