Information Technology Reference
In-Depth Information
}
/* A third attack -- This one works if the second byte of
the cipher (z) is 0, the value of the S[] array at
location p (the unknown key byte were looking for) is 0,
and the third (index=2) element of the S[] array isn't
zero */
if ((o2 == 0) && (S[p] == 0) && (S[2] != 0))
{
stat3[(2-j-S[p]) & 0xff]++; /* extract the info and
keep track of it */
}
// and two more (well there are still about 10 of 'em left:)
/* The next two start with the same requirements. The
second element (index=1) of S[] must be greater than the
value of the unknown key byte we're searching for and
the second (index=1) element of S[] plus the third
(index=2) minus the value of p (the unknown key byte
we're searching for) must be zero
*/
if ((S[1] > p) && (((S[2]+S[1]-p) & 0xff) == 0))
{
/* once this condition is met, one of two more
conditions are needed to qualify */
/* The first is the second byte of the keystream (z)
should be equal to S[1] */
if (o2 == S[1])
{
/* Now find the first value in the S[] array that
doesn't have a value
of S[1] - S[2]. Save that index
*/
for (jp=0; S[jp] != ((S[1]-S[2]) & 0xff); jp++);
/* As long as that index isn't 1 or 2, we can do an
extraction and save it */
if ((jp!=1) && (jp!=2)) stat4[(jp-j-S[p]) & 0xff]++;
}
else
{
/* The other option is to see if the second byte of
the keystream (z) is
equal to 2 minus the third value in the S[] array
(index=2)
*/
if (o2 == ((2-S[2]) & 0xff))
{
/* Find the first index of the S[] array where
the value isn't the same as the second byte of
the keystream (z)*/
Search WWH ::




Custom Search