IPSec can detect any modification of the message. Bob sent "I love you." to Alice. But an attacker could alter the message into "I hate you." IPSec computes the checksum computed from both an individual IP packet and the shared key. IPSec adds the checksum to the IP packet. The intended recipients checks the checksum The recipients can detect that someone modifies some parts of the packet if the check fails. There is Authentication Header, AH for this purpose.