Now this is true and it's a technical point perhaps but it's one that must be
dealt with in practice and the solution is rather simple.
The solution is just use a key derivation mechanism and
what this means is that the parties with take their shared secret information k.
And map that onto a random looking key of length n.
And they can do this by simply, running their shared secret, k, through a suitable
hash function to obtain a shared string, a shared secret string, k prime.
I don't want to get into too much,
discussion about the exact requirements for the hash function h.
I'll mention that you need stronger properties than collision resistance,
you need some kind of random looking property on h, but
I do not want to get into that here.
Suffice it to say that this is essentially what is done in practice,
to derive a shared bit string of the appropriate length
after running the Diffie-Hellman protocol.