Check out the new USENIX Web site. next up previous
Next: Recommendations Up: Password Decoding Details Previous: Passwords of 4 Characters

Passwords Greater Than 4 Characters:

The encoding scheme for long length passwords (up to 31 characters in length) is more complicated than for short length passwords, although it, too, is reversible.

$A$ = ASCII password
$B$ = 64-byte constant block
$C$ = encoded password block

First, $A$ is padded to 32 bytes in the following fashion:

j = strlen(A);

while (j < 32)
{
   for (i = j; i < j * 2; ++i)
      // increment each ASCII value by j
      A[i] = A[i - j] + j;

   j = j * 2;
}
The resultant 32-byte array, $A$, is then passed through four rounds of a function which XORs against a 64-byte constant (Figure 5). $k$ is an index that begins at {2,16,24,8} for each of the four rounds.

j = (A[k] + A[k+1]) & 0x3F; // 6 LSB
shift = (A[k+2] + A[k+3]) & 0x07; // 3 LSB

for (i = 0; i < 32; ++i, ++j, ++k)
{
   // wrap around to beginning
   if (j == 64) j = 0;
   if (k == 32) k = 0;

   temp = B[j]; // xy
   temp <<= 8;
   temp |= B[j]; // xyxy

   temp >>= shift;

   C[k] XOR= (unsigned char) temp;
}
The resultant 32-byte encoded password block (example in Figure 6) does not have any immediately visible remnants of the constant block as the short length encoding method does. However, it is still reversible with minimal computing resources.

Figure 5: 64-byte constant block for use with passwords greater than 4 characters
\begin{figure}
\footnotesize
\begin{verbatim}
B1 56 35 1A 9C 98 80 84 37 A7...
...
C5 66 B3 D3 45 9A AF DA 29 86 22 6E B8 03 62 BC\end{verbatim}
\end{figure}

Figure 6: Encoded password block of ASCII password `testa'
\begin{figure}
\footnotesize
\begin{verbatim}
18 0A 43 3A 17 7D A3 CA D7 9D...
...
F1 71 07 03 5A 52 4B B9 70 2D B2 D1 DF A5 54 07\end{verbatim}
\end{figure}



Kingpin
2001-05-09