A
cryptographic key is a small secret piece of information, without which the encrypted data should not be accessible.
Typical key sizes are 128 bits for symmetric ciphers and 1024 bits or more for public key cryptography.
A good cryptographic algorithm should be secure provided the key is kept secret, even if all other details of the system are assumed to be known to an attacker.
If the key size is too small, the algorithm may be vulnerable to
- a 'brute-force' attack in which all possible values of the key are tried one by one, or
- a 'birthday' attack, where the fact that probability of a collision between a large group of values goes up roughly as the square of the number of values is used to reduce the need for exhaustive computation