Stochastic Tools For Network Security: Anonymity Protocol Analysis And Network Intrusion Detection