The most secure way to calculate a key is by using a secure key derivation function (KDF), the output of which is a derived key. Derived keys are just as secure as random keys, but they have some significant practical advantages. In particular, they make it much cheaper to buy, use, and maintain systems that employ them.