2

Quoting from https://en.wikipedia.org/wiki/Key_size

With a key of length n bits, there are 2n possible keys. This number grows very rapidly as n increases. The large number of operations (2128) required to try all possible 128-bit keys is widely considered out of reach for conventional digital computing techniques for the foreseeable future.

Why is the formula 2 to the power of (whatever the key size might be)?

user
  • 7,795
  • 2
  • 31
  • 57
cyzczy
  • 1,578
  • 5
  • 23
  • 42
  • 2
    Because on each bit you can have either 0 or 1. So on one bit you can have 1^2 = 2 combinations which is 0 and 1. On two bits, you can have 2^2 = 4 combinations 00, 01, 10, 11. And then on 3 bits you can have 2^3 = 8 - 000, 001, 010, 011, 100, 101, 110, 111. – Aria Aug 01 '16 at 20:19

3 Answers3

2

A bit is a single 0 or 1. So if you have a 1-bit key, you have just two possibilities: 0, or 1.

If you have a 2-bit key, you have two possibilities for the first bit, and two for the second bit. This gives you 2*2 = 4 possibilities. They are 00, 01, 10, and 11.

If you have a 3-bit key, you have two possibilities for the first bit, two for the second bit, and two for the third bit. This gives you 2*2*2 = 8 possibilities. They are 000, 001, 010, 011, 100, 101, 110, and 111.

So as you can see, the general formula is 2^n possible keys.

tlng05
  • 10,384
  • 1
  • 35
  • 36
1

Because a bit can either be 0 or 1, so there are 2^1 =2 1-bit keys, 2^2 =4 2-bit keys, and so on. More in general, there are 2^n possible n-bit keys.

A. Darwin
  • 3,602
  • 2
  • 17
  • 27
1

Bits are binary, which means they can be either 1 or 0. So a key of length one would have two combinations, 1 and 0. Therefore a key with a length of two would have four combinations (2^2), 00 01 10 11. As you can see, the number of combinations increases greatly with length as is a trait of exponential growth.