Explain why the length of the key does matter?

Technology CommunityCategory: CryptographyExplain why the length of the key does matter?
VietMX Staff asked 3 years ago

Consider, for example, the simple encryption of shifting every letter one to the right in the alphabet, so that A becomes B, B becomes C, and so forth. So that: HELLO becomes encrypted as: IFMMP

I can shift one letter to the right, two letters to the right, or up to 25 letters to the right. Consider the “number of letters to the right” as the “key”. It takes 5 bites to hold a number between 0 and 25. Therefore, the key size is “5 bits”.

Now, the problem with a 5 bit key is that it only has 32 combinations. If I know the encryption algorithm, I can all 32 keys until I find the right combination. The larger the key, the harder this becomes – EXPONENTIALLY. A 6 bit key has 64 combinations, a 7 bit key has 128 combinations, and so forth. A 10 bit key has a thousand combinations, a 20 bit key has a million combinations, a 30 bit key has a BILLION combinations.

Let’s say that you have a computer that can test a billion keys per second trying to brute force all combinations. That means you can break a 30 bit key in just one second. But, that means it will take you a billion seconds (or 34 years) to break a 60 bit key.

Every 30 bits we add makes it a billion times more difficult. A spy agency like the NSA can crack 60 bit keys using supercomputers, but a 90 bit key is a billion times more difficult to crack, and a 120 bit key would be a further billion times more difficult to crack than a 90 bit key.

That’s why older WEP (40 bits) and DES (56 bits) are considered obsolete: we can crack them with desktop computers by trying all combinations. That’s why modern crypto, such as AES, uses 128 bits. We can’t brute force crack those algorithms.