A Balanced Trust-based Method to Counter Sybil and Spartacus Attacks in Chord