N-body simulations of slow tidal encounters and the formation of galactic halos