Data Encryption with SSL/TLS
The first problem can be resolved by simply encrypting the data. The second problem is more difficult because it requires us to detect that data has been changed. SSL accomplishes this by adding a message digest to all transmitted data. A message digest is a condensed representation of any message. The Secure Hash Algorithm (SHA) produces a 20-byte message digest for every packet of data. If any component of the data changes, the message digest almost certainly changes. Both the sending and receiving side of a connection perform the message digest on the unencrypted data. The receiving side then insures that the message digests are the same before accepting the data.
There are two types of encryption algorithms that are used within SSL. They are asymmetrical encryption and symmetrical encryption.