# When using DES, how large would the key space be if we only use letters as characters?

Would it be safe? Or is it susceptible to brute force attacks or something else?

## 2 Answers

A DES key is 56 bits. If we assume letters are ASCII encoded and take 8 bits each this means a DES key of only letters would be 7 letters long. Given that there are 26 letters in the roman alphabet we would have $26^7 \approx 2^{33}$ possible keys, or if we allow uppercase and lowercase, $52^7 \approx 2^{40}$ possible keys. Both keyspaces can quickly be enumerated with modern hardware and can easily be brute forced.

• By another reading of the question, we use 8 ASCII characters A-Z as key, the low-order bit of each is ignored so we end up with 14 possible values, the keyspace is $14^8\lessapprox2^{30.5}$; or $28^8\lessapprox2^{38.5}$ with lowercase. – fgrieu Sep 17 '18 at 13:44

If the intention is to stuff as many letters into a 56 bit DES key as possible, then you can get 11 (and a bit) in if you ignore case. You can decode the ASCII values to reduce the bits necessary to represent the characters. Then 56/log(2;26) = 11.9.

So your key space would be 26^11 or 51.7 bits. That's almost full strength DES, but still low for today's attack hardware. And of course DES is deprecated.