In cryptography, the key space of an algorithm refers to the set of all possible keys that can be used to initialize the cryptographic algorithm. For example, if an algorithm works using a key that is a string of 10 bits, then its key space is the set of all binary strings of length 10 bits; i.e. we have key space of size 2 = 1024.