Data Encryption with SSL/TLS

When data is sent across an unsecured line, it has to deal with two types of problems:
  1. The data can be read by unauthorized people.
  2. The data can be altered by unauthorized people.

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.