It provides secure communications transparently, with no changes required to existing applications. IP Versions 4 and 6 environments. On the receiver's side, the data is decapsulated using the same function and key. If either the data has been altered or the sender's key was not valid, the datagram is discarded. Encryption uses a cryptographic algorithm to modify and randomize the data using a certain algorithm and key to produce cyphertext.
Encryption makes the data unreadable while in transit.
Encryption must occur with authentication to verify the data integrity of the encrypted data. When it is desired to have authentication and integrity checking without confidentiality, the AH may be used alone. With AH, the static fields of the IP header and the data have a hash algorithm applied to compute a keyed digest. The receiver uses its key to compute and compare the digest to make sure the packet is unaltered and the sender's identity is authenticated.