# TLS: How is the shared secret (via Diffie-Hellman) used in the symmetric crypto function?

So let's say we use a cipher suite with DH key exchange and AES symmetric encryption. Alice and Bob both end up with the same shared secret key $k$.

How is this value k used in e.g. AES? Will it be hashed before use, or is there a PBKDF involved? And what do we do about small $k$ (e.g. $10, …$)

For small values of $k$: First, keep in mind that these are constant-width data types. The output of 1024-bit Diffie-Hellman is always 1024 bits, regardless of the numeric value. If you mean "what about brute-forcing," this is what "high-quality premaster secrets" is about. While it's possible DH might result in an output of 10, it's monumentally unlikely. Any attacker who's starting his brute-forcing at zero and going up is an idiot, who will almost certainly never break any connection. If the attacker guesses what your key is, he can break the connection, but the point is that he can't feasibly guess it.