MasterOishi Admin
จำนวนข้อความ : 357 Registration date : 08/05/2007
| เรื่อง: [] öʹ *.ipf Thu Jun 21, 2007 8:07 pm | |
| - Code:
-
(I-a) Using the password, initializing three 32bit keys
Void CRYPT: : InitKeys () { Key [ 0 ] = 0x12345678L; Key [ 1 ] = 0x23456789L; Key [ 2 ] = 0x34567890L;
For (int i=0; &pwd [ i ] < &pwd[48]; i++){ UpdateKeys (&pwd [ i ]); } }
(I-b) (I-a) Details. The algorithm of crc32 is jointly used
Void CRYPT: : UpdateKeys (unsigned char* c) { Key [ 0 ] = crc_table [ (key [ 0 ] ^ *c) & 0xff ] ^ (key [ 0 ] >> 8); Key [ 1 ] += key [ 0 ] & 0xff; Key [ 1 ] = key [ 1 ] * 0x8088405L + 1; Key [ 2 ] = crc_table [ (key [ 2 ] ^ (key [ 1 ] >> 24)) & 0xff ] ^ (key [ 2 ] >> 8); }
(II) (I-b) So using the false random number which is renewed, forming the xor key
Int CRYPT: : DecryptByte () { Int tmp = (key [ 2 ] & 0x0fffd) | 2; Return (tmp * (tmp ^ 1)) >> 8; }
(III) The filename length minute loop doing.
For (int i=0; I < len; i++){ Buf [ i ] ^= crypt.decryptByte (); Crypt.updateKeys (&buf [ i ]); }
Above filename (n) series of decoding. When 1byte it decodes, using that 1byte, because it forms false random number, xor-key yes changing in such sense, thing ・・
Therefore the encoding algorithm of well old PKZIP, it is certain to be fragility. ҡ Pramool.com | |
|