Trust Reputation and Security: Theories and Practice