I wanna know what exactly SP array does Please only look at for loop in source code below, especially SP1,SP2,SP3.......
Is it similar to what S-box does?(Ignore the other) 

int fval, work, right, leftt;
int round;
int keysi = 0;

leftt = inInts[0];
right = inInts[1];

work   = ((leftt &gt;&gt;  4) ^ right) &amp; 0x0f0f0f0f;
right ^= work;
leftt ^= (work &lt;&lt; 4);

work   = ((leftt &gt;&gt; 16) ^ right) &amp; 0x0000ffff;
right ^= work;
leftt ^= (work &lt;&lt; 16);

work   = ((right &gt;&gt;  2) ^ leftt) &amp; 0x33333333;
leftt ^= work;
right ^= (work &lt;&lt; 2);

work   = ((right &gt;&gt;  8) ^ leftt) &amp; 0x00ff00ff;
leftt ^= work;
right ^= (work &lt;&lt; 8);
right  = (right &lt;&lt; 1) | ((right &gt;&gt; 31) &amp; 1);

work   = (leftt ^ right) &amp; 0xaaaaaaaa;
leftt ^= work;
right ^= work;
leftt  = (leftt &lt;&lt; 1) | ((leftt &gt;&gt; 31) &amp; 1);

for ( round = 0; round &lt; 8; ++round )
    {
    work   = (right &lt;&lt; 28) | (right &gt;&gt; 4);
    work  ^= keys[keysi++];
    fval   = SP7[ work        &amp; 0x0000003f ];
    fval  |= SP5[(work &gt;&gt;  8) &amp; 0x0000003f ];
    fval  |= SP3[(work &gt;&gt; 16) &amp; 0x0000003f ];
    fval  |= SP1[(work &gt;&gt; 24) &amp; 0x0000003f ];
    work   = right ^ keys[keysi++];
    fval  |= SP8[ work         &amp; 0x0000003f ];
    fval  |= SP6[(work &gt;&gt;  8) &amp; 0x0000003f ];
    fval  |= SP4[(work &gt;&gt; 16) &amp; 0x0000003f ];
    fval  |= SP2[(work &gt;&gt; 24) &amp; 0x0000003f ];
    leftt ^= fval;
    work   = (leftt &lt;&lt; 28) | (leftt &gt;&gt;&gt; 4);
    work  ^= keys[keysi++];
    fval   = SP7[ work         &amp; 0x0000003f ];
    fval  |= SP5[(work &gt;&gt;  8) &amp; 0x0000003f ];
    fval  |= SP3[(work &gt;&gt; 16) &amp; 0x0000003f ];
    fval  |= SP1[(work &gt;&gt; 24) &amp; 0x0000003f ];
    work   = leftt ^ keys[keysi++];
    fval  |= SP8[ work         &amp; 0x0000003f ];
    fval  |= SP6[(work &gt;&gt;  8) &amp; 0x0000003f ];
    fval  |= SP4[(work &gt;&gt; 16) &amp; 0x0000003f ];
    fval  |= SP2[(work &gt;&gt; 24) &amp; 0x0000003f ];
    right ^= fval;
    }

right  = (right &lt;&lt; 31) | (right &gt;&gt; 1);
work   = (leftt ^ right) &amp; 0xaaaaaaaa;
leftt ^= work;
right ^= work;
leftt  = (leftt &lt;&lt; 31) | (leftt &gt;&gt; 1);
work   = ((leftt &gt;&gt;  8) ^ right) &amp; 0x00ff00ff;
right ^= work;
leftt ^= (work &lt;&lt; 8);
work   = ((leftt &gt;&gt;  2) ^ right) &amp; 0x33333333;
right ^= work;
leftt ^= (work &lt;&lt; 2);
work   = ((right &gt;&gt; 16) ^ leftt) &amp; 0x0000ffff;
leftt ^= work;
right ^= (work &lt;&lt; 16);
work   = ((right &gt;&gt;  4) ^ leftt) &amp; 0x0f0f0f0f;
leftt ^= work;
right ^= (work &lt;&lt; 4);
outInts[0] = right;
outInts[1] = leftt;
Other than the oddity/bug in final note, this seems to be a classical, speed-optimized implementation of standard DES (for what we see; there could be variations in the S-table content, exact bit twidling in permutation P, or key scheduling).

The code has:


IP, final permutation and IP-1 per Richard Outerbridge's method.
Pre-rotation by 1 bit before the round loop, undone afterwards, in order to  need no shift (rather than a 1-bit rotation) for SP8, and shifts counts that most are multiples of 8 (which excellent compilers for 8-bit CPU love).
Two DES rounds per partially unrolled round loop, so that the 8 loops perform 16 rounds.
Pre-computed 6-bit subkeys grouped as two 32-bits words (with 8 unused bits in each), merged in parallel for 4 S-boxes at a time. Correspondingly, it is applied subkeys on the input of expansion E.
Expansion E reduced to rotating the appropriate part of right or left into the low-order 6 bits, and masking to keep these bits before indexing the S tables. This uses that E is highly regular, and combines with E.
Permutation P merged with the S-boxes, which is the game-changing optimization of DES in software. SPj is DES's S-box j with expansion E (modified to account for the 1-bit pre-rotation) applied on the output, that is indexing SPj[x] yield E(SPj(x)), give or take the 1-bit pre-rotation. A table's output width thus grows from 4-bit to 32-bit. There's a data size penalty: S-boxes now eat 16384 bits of table rather than 2048.
Note: It is not used the size optimization that keeps the bitwise-OR of the eight 32-bit tables and extracts the bits with eight 32-bit masks, which used to be classical in heavily size-constrained CPUs.




Note: a variant does without fval, clarifying per my taste. I sneaked in some comments.

for ( round = 0; round &lt; 8; ++round )
    {
    // apply E, subkeys, S and P for odd  S-boxes, rounds changing leftt
    work   = keys[keysi++] ^ ((right &lt;&lt; 28) | (right &gt;&gt; 4)); 
    leftt ^= SP7[ work        &amp; 0x3f ];
    leftt ^= SP5[(work &gt;&gt;  8) &amp; 0x3f ];
    leftt ^= SP3[(work &gt;&gt; 16) &amp; 0x3f ];
    leftt ^= SP1[(work &gt;&gt; 24) &amp; 0x3f ];
    // apply E, subkeys, S and P for even S-boxes, rounds changing leftt
    work   = keys[keysi++] ^ right;
    leftt ^= SP8[ work        &amp; 0x3f ];
    leftt ^= SP6[(work &gt;&gt;  8) &amp; 0x3f ];
    leftt ^= SP4[(work &gt;&gt; 16) &amp; 0x3f ];
    leftt ^= SP2[(work &gt;&gt; 24) &amp; 0x3f ];
    // apply E, subkeys, S and P for odd  S-boxes, rounds changing right
    work   = keys[keysi++] ^ ((leftt &lt;&lt; 28) | (leftt &gt;&gt; 4));
    right ^= SP7[ work        &amp; 0x3f ];
    right ^= SP5[(work &gt;&gt;  8) &amp; 0x3f ];
    right ^= SP3[(work &gt;&gt; 16) &amp; 0x3f ];
    right ^= SP1[(work &gt;&gt; 24) &amp; 0x3f ];
    // apply E, subkeys, S and P for even S-boxes, rounds changing right
    work   = keys[keysi++] ^ leftt;
    right ^= SP8[ work        &amp; 0x3f ];
    right ^= SP6[(work &gt;&gt;  8) &amp; 0x3f ];
    right ^= SP4[(work &gt;&gt; 16) &amp; 0x3f ];
    right ^= SP2[(work &gt;&gt; 24) &amp; 0x3f ];
    }




Off-topic note: The question's code contains the idiom &gt;&gt;&gt; which is an indication that it is it Java (where this means logical shift right).
If so, some &gt;&gt; needs to be changed to &gt;&gt;&gt;, at least in (right &lt;&lt; 28) | (right &gt;&gt; 4) and similar, because in Java &gt;&gt; is specified to leave the high-order bit of (32-bit) int unchanged, which is not the intention.
On the other hand, if this is C, all int should be changed to unsigned, or better uint32_t, because using &gt;&gt; on a signed variable is not fully specified in C, giving results that depend on the compiler's mood.