Hacking - The Art of Exploitation, 2nd Edition

(Romina) #1

436 0x700


Now when keystream data is needed, the Pseudo-Random Generation
Algorithm (PRGA) is used. This algorithm has two counters, i and j, which
are both initialized at 0 to begin with. After that, for each byte of keystream
data, the following pseudo-code is used.

i = (i + 1) mod 256;
j = (j + S[i]) mod 256;
swap S[i] and S[j];
t = (S[i] + S[j]) mod 256;
Output the value of S[t];

The outputted byte of S[t] is the first byte of the keystream. This algorithm
is repeated for additional keystream bytes.
RC4 is simple enough that it can be easily memorized and implemented
on the fly, and it is quite secure if used properly. However, there are a few
problems with the way RC4 is used for WEP.

0x780 WEP Attacks............................................................................................


There are several problems with the security of WEP. In all fairness, it was
never meant to be a strong cryptographic protocol, but rather a way to provide
a wired equivalency, as alluded to by the acronym. Aside from the security
weaknesses relating to association and identities, there are several problems
with the cryptographic protocol itself. Some of these problems stem from
the use of CRC32 as a checksum function for message integrity, and other
problems stem from the way IVs are used.

0x781 Offline Brute-Force Attacks............................................................


Brute forcing will always be a possible attack on any computationally secure
cryptosystem. The only question that remains is whether it’s a practical attack
or not. With WEP, the actual method of offline brute forcing is simple:
Capture a few packets, then try to decrypt the packets using every possible
key. Next, recalculate the checksum for the packet, and compare this with
the original checksum. If they match, then that’s most likely the key. Usually,
this needs to be done with at least two packets, since it’s likely that a single
packet can be decrypted with an invalid key yet the checksum will still be
valid.
However, under the assumption of 10,000 cracks per second, brute forcing
through the 40-bit keyspace would take over three years. Realistically, modern
processors can achieve more than 10,000 cracks per second, but even at
200,000 cracks per second, this would take a few months. Depending on
the resources and dedication of an attacker, this type of attack may or may
not be feasible.
Tim Newsham has provided an effective cracking method that attacks
weaknesses in the password-based key-generation algorithm that is used
by most 40-bit (marketed as 64-bit) cards and access points. His method
effectively reduces the 40-bit keyspace down to 21 bits, which can be cracked
Free download pdf