Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In SSL/TLS, we use symmetric and asymmetric keys to encrypt the data. Does that mean that the keys are used to encrypt the data (preserve the integrity) or provide a secure channel for the data to be sent?

And as far as I know, hashing algorithms – inside of the SSL handshake protocol – are used to provide data integrity. So when data is encrypted via SSL/TLS, do they:

  1. Encrypt the data like hash algorithm, or
  2. Encrypt the data so that there is no eavesdropping of data? Meaning: they provide a secure channel which means they make use of symmetric, asymmetric key to preserve data confidentiality (no eavesdropping) and hashing to preserve integrity?
share|improve this question
No problem. People sometimes make mistakes. But you’ve cleaned up, that’s great! As for the answer(s) you are waiting for – just be a bit patient. Less than 14 hours is nothing! At least give it a day or two for people to post answers. Remind yourself: not everyone is online all the time. Some of our members are currently sleeping, others are having breakfast or dinner… it’s a big planet with a lot of timezones. But I’m pretty sure someone will post an answer soon, just like they did with your previous questions. ;) – e-sushi Sep 3 '14 at 7:16
up vote 2 down vote accepted

The answer to the first question is both.

TLS uses a custom PRF based on HMAC to generate symmetric and MAC keys from a shared secret. The shared secret is created during the asymmetric key exchange between client and server as part of the handshake.

The PRF generates key material of a required length. That length is determined by the key sizes and the key quantity. Those are related to the ciphersuite chosen. If an encryption algorithm provides both confidentiality and integrity (like AES-GCM), only 1 key per party is generated. If HMAC is used to provide integrity, 2 keys are generated. The PRF may also generated initialization vectors.

Different keys are generated for both client and server, so there are 2 keys generated for authenticated encryption algorithms, and 4 keys for algorithms that require a MAC for integrity. The keys used to encrypt the data in transit are used with symmetric algorithms. For data secured by TLS, the hash algorithms are used in the MAC, and not part of the encryption process.

share|improve this answer
So when a website is SSL enabled, the server makes use of SSL certificates to ensure authenticity,integrity and non-repudiation. So, here only the channel is made secured right???there is no encryption of data taking place right???? – user3592502 Sep 3 '14 at 8:45
The channel is the data, could you be more specific? I cannot speak for SSL, just the current iteration of TLS. – Richie Frame Sep 3 '14 at 9:48

The question whether SSL/TLS is used for maintaining data confidentiality, is actually not as straight-forward as one might think. It depends.

We might disregard the deprecated SSL cipher suites that provided authenticity and integrity with a NULL bulk encryption algorithm. Even if you only take the cipher suites that do encrypt the bulk contents into consideration, that doesn't necessarily mean you get confidentiality.

The reason is quite simple: A SSL/TLS server might allow anonymous clients to connect. If anyone is allowed to connect and download the contents, the contents aren't very confidential, are they?

Consequently: - SSL/TLS will typically not protect the confidentiality of the data provided by the server. It is not enough to slap SSL/TLS on a server, to ensure that only authorized clients will get access to the contents published by the server. - SSL/TLS will however protect the confidentiality of the data provided by the client. Once the client has authenticated the server identity and established an authenticated and encrypted channel, no one but the server will be able to read the contents of the communication. This includes any authentication tokens the client might want to provide to the server to authenticate itself.

Hence, you will only get confidentiality in both directions (client to server as well as server to client) only once the client has authenticated itself to the server.

share|improve this answer
So what about the hashing function which comes under the handshake protocol of the SSL/TLS. They are used for data integrity right?? So data as a whole is confidential as well as their integrity is preserved right?? – user3592502 Sep 3 '14 at 9:30
Please read the answer again. Data as a whole might not necessarily be confidential, just because it is encrypted. The hash functions are used for the message authentication codes and (in TLS 1.2 and up) for the PRF that is used e.g. for deriving bulk encryption keys. The description in the other answer is generally correct in this respect. – Henrick Hellström Sep 3 '14 at 9:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.