To prevent spoofing, use digital signatures.
If the digital signature on a message can be confirmed, you know that:
- Only the person who signed the message (the signer) could have signed it (authenticity), and
- The signer could only have signed this message, i.e., the message could not have been tampered with (integrity)