Session key


A session key is a single-use symmetric key used for encrypting all messages in one communication session. A closely related term is content encryption key, traffic encryption key, or multicast key which refers to any key used for encrypting messages, contrary to other uses like encrypting other keys.
Session keys can introduce complications into a system, yet they solve some real problems. There are two primary reasons to use session keys:
  1. Several cryptanalytic attacks become easier the more material encrypted with a specific key is available. By limiting the amount of data processed using a particular key, those attacks are rendered harder to perform.
  2. asymmetric encryption is too slow for many purposes, and all secret key algorithms require that the key is securely distributed. By using an asymmetric algorithm to encrypt the secret key for another, faster, symmetric algorithm, it's possible to improve overall performance considerably. This is the process used by PGP and GPG.
Like all cryptographic keys, session keys must be chosen so that they cannot be predicted by an attacker, usually requiring them to be chosen randomly. Failure to choose session keys properly is a major design flaw in any crypto system.