Lets for example say that you need a 1024 bit key length. So to store that key you need 1024 bits. But you can not really use all those possible keys. If your key is 1 then it may still be 1024, just with lots of leading 0’s. But it is a very bad key as it is easily decrypted. So in practice the first bit needs to be a 1 to get a big number so you have a key space of 1023 usable keys.
But that is just the start. Your key might have to be a prime number. First off all the even numbers are removed from the key space leaving 1022 bits. In fact if you eliminate all the non-primes you are only left with 1013.5 bits in your key space, even though your key length is still 1024.
The more restrictions you put on the key the smaller the key space is which could be a problem when faced with brute force algorithms and birthday attacks. If your key space is too small you need to increase the key length which adds computing complexity. Ideally the key space is the same size as the key length but this is hard to accomplish.
Latest Answers