Friedrich Nietzsche said this quote

Speaking generally punishment hardens and numbs it produces concentration it sharpens the consciousness of alienation it strengthens the power of resistance.