Key space
Encyclopedia
In cryptography
, an algorithm's
key space refers to the set of all possible keys
that can be used to initialize it. For example, if an algorithm works using a key that is a string
of 10 bit
s, then its key space is the set of all binary
strings of length 10. i.e. we have key space of size 210 = 1024.
To avoid adversaries from guessing the key using a brute-force attack, the key space is usually designed to be extremely large. Another desirable attribute is that the key space be flat, having no or very few weak key
s. In most cases, it suffices to search 50% of the key space to find the solution.
Rijndael/AES uses a key of up to 256 bits, resulting in a key space containing over 2256 (or 1.1579 × 1077) keys. This makes it computationally unfeasible to check each possible key by brute force.
In the DES
block cipher, a 56-bit key is used, resulting in a relatively small
key space of size 256 (or 7.2058 x 1016).
The ROT13
cipher is only intended to prevent people from accidentally reading messages (e.g. movie plot details). As there is no key, the key space is therefore empty.
Cryptography
Cryptography is the practice and study of techniques for secure communication in the presence of third parties...
, an algorithm's
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...
key space refers to the set of all possible keys
Key (cryptography)
In cryptography, a key is a piece of information that determines the functional output of a cryptographic algorithm or cipher. Without a key, the algorithm would produce no useful result. In encryption, a key specifies the particular transformation of plaintext into ciphertext, or vice versa...
that can be used to initialize it. For example, if an algorithm works using a key that is a string
String (computer science)
In formal languages, which are used in mathematical logic and theoretical computer science, a string is a finite sequence of symbols that are chosen from a set or alphabet....
of 10 bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...
s, then its key space is the set of all binary
Binary numeral system
The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2...
strings of length 10. i.e. we have key space of size 210 = 1024.
To avoid adversaries from guessing the key using a brute-force attack, the key space is usually designed to be extremely large. Another desirable attribute is that the key space be flat, having no or very few weak key
Weak key
In cryptography, a weak key is a key, which, used with a specific cipher, makes the cipher behave in some undesirable way. Weak keys usually represent a very small fraction of the overall keyspace, which usually means that, if one generates a random key to encrypt a message, weak keys are very...
s. In most cases, it suffices to search 50% of the key space to find the solution.
Examples
The block cipherBlock cipher
In cryptography, a block cipher is a symmetric key cipher operating on fixed-length groups of bits, called blocks, with an unvarying transformation. A block cipher encryption algorithm might take a 128-bit block of plaintext as input, and output a corresponding 128-bit block of ciphertext...
Rijndael/AES uses a key of up to 256 bits, resulting in a key space containing over 2256 (or 1.1579 × 1077) keys. This makes it computationally unfeasible to check each possible key by brute force.
In the DES
Data Encryption Standard
The Data Encryption Standard is a block cipher that uses shared secret encryption. It was selected by the National Bureau of Standards as an official Federal Information Processing Standard for the United States in 1976 and which has subsequently enjoyed widespread use internationally. It is...
block cipher, a 56-bit key is used, resulting in a relatively small
EFF DES cracker
In cryptography, the EFF DES cracker is a machine built by the Electronic Frontier Foundation in 1998 to perform a brute force search of DES cipher's key space — that is, to decrypt an encrypted message by trying every possible key...
key space of size 256 (or 7.2058 x 1016).
The ROT13
ROT13
ROT13 is a simple substitution cipher used in online forums as a means of hiding spoilers, punchlines, puzzle solutions, and offensive materials from the casual glance. ROT13 has been described as the "Usenet equivalent of a magazine printing the answer to a quiz upside down"...
cipher is only intended to prevent people from accidentally reading messages (e.g. movie plot details). As there is no key, the key space is therefore empty.