WhatsApp encrypts messages using the RC4 protocol and obtains a hash from either a user's IMEI number on Android or MAC address on iPhone. However, WhatsApp initially sends some identifying information such as a user's phone number in plain text, which could allow others to intercept this data on unsecured networks. It is recommended to use a VPN when sending WhatsApp messages on public Wi-Fi networks to help prevent this type of interception.