How we use Hash function to ensure the security of online communication

Explain how can we use Hash function to ensure the security of online communication?
How can we use Hash functions for intrusion and virus detections?