I am trying to understand why TLS only uses hashing algorithm like SHA-384 instead of using an HMAC instance like HMAC-SHA-384.
If I understand correctly, this cipher suite (ECDHE_ECDSA_WITH_AES_128_GCM_SHA256) means:
- It uses Elliptic Curve Diffie-Hellman Ephemeral for Key Exchange in an insecure channel (internet).
- It uses Elliptic Curve Digital Signature Algorithm for Authentication to ensure you are connecting to the intended party.
- It uses (AES 128 GCM) for encryption to provide confidentially over an insecure channel.
- It uses (SHA256) for hashing to ensure data integrity.
With that, here come my questions:
- How does the hash get used? Are we first hashing the data and then encrypting it?
- If we are simply appending the hash key into the data H(key||data), why don't we use HMAC as it is more robust?
- Follow-up question, why do we need to sign our data if both parties have secured their encryption key, hashing key (My assumption here is if encryption and hashing are done correctly, only the intended party can decrypt and verify the data, so why bother signing the data)?