The Security of Multi-Party Protocols in Distributed Systems