Attack-resilient Credit-based Reputations for Peer-to-Peer Content Distribution