A distributed and privacy-preserving method for network intrusion detection