There are many farm Assistant tools that I want to write, just like me. But I don't know how to deal with the QQ login problem. I don't feel at ease with others, so I want to do it myself. However, many users do not know how to do this. So ......
Now I will write out the password encryption method for your convenience and use it with greater confidence.
1. Files used for QQ encryption, that is, files used for MD5 calculation.
Http://imgcache.qq.com/ptlogin/js/comm.js
2. Import the content of the above file into "jscript"
. Version 2
. Supports library script
Script Component = script component 1
Script component. Language = "jscript"
Script component. Timeout =-1
Script component. Execute (obtain the byte set data (# JScript, # text type ,))
Encrypted value = script component. Run ("md5_3", passwords)
Encrypted value = script component. Run ("MD5", encrypted value + to uppercase (Verification code value ))
Combination of submitted information = "u =" + uid + "& P =" + encrypted value + "& verifycode =" + verification code value + "& Aid = 15000102 & U1 = http % 3A % 2f % 2fxiaoyou.qq.com % 2findex. PHP % 3 fmod % 3 dlogin & fp = & H = 1 & ptredirect = 1 & ptlang = 0 & from_ui = 1 & dumy ="
Login return information = utf8 to ANSI (HTTP. Access Network ("http://ptlogin2.qq.com/login"," Post ", and submit information ))
. If (search for text (LOGIN return information, "Mod = login", false)> 0)
Return (true) 'login successful
. Otherwise
Return (false)
Go to: http://hi.baidu.com/%C1%E8%D4%C6%D7%B7%B7%E7/blog/item/2964ccdc863036a9cd1166f6.html
VaR hexcase = 1;
VaR b64pad = "";
VaR chrsz = 8;
VAR mode = 32;
Function preprocess (a) {// here, a is the table data
VaR B = "";
B + = A. verifycode. value; // The value of the verification code.
B = B. touppercase (); // here, the verification code is converted into uppercase letters.
A. P. value = MD5 (md5_3 (A. P. Value) + B );
// Encrypt the data in the password box by using MD5. First, process the md5_3 password and then use MD5 together with the verification code.
Return true
}
// Let's take a look at the content of md5_3.
Function md5_3 (B ){
VaR A = new array; // apply for an array
A = core_md5 (str2binl (B), B. length * chrsz); // Let's see what happened to str2binl. Multiply the length of B by 8
// The str2binl function compresses the first three digits, converts each letter to Unicode, and shifts it to see what core_md5 is.
A = core_md5 (A, 16 * chrsz );
A = core_md5 (A, 16 * chrsz );
Return binl2hex ()
}
Function MD5 (){
Return hex_md5 ()
}
Function hex_md5 (){
Return binl2hex (core_md5 (str2binl (A), A. length * chrsz ))
}
Function b64_md5 (){
Return binl2b64 (core_md5 (str2binl (A), A. length * chrsz ))
}
Function str_md5 (){
Return binl2str (core_md5 (str2binl (A), A. length * chrsz ))
}
Function hex_hmac_md5 (a, B ){
Return binl2hex (core_hmac_md5 (a, B ))
}
Function b64_hmac_md5 (a, B ){
Return binl2b64 (core_hmac_md5 (a, B ))
}
Function str_hmac_md5 (a, B ){
Return binl2str (core_hmac_md5 (a, B ))
}
Function md5_vm_test (){
Return hex_md5 ("ABC") = "900150983cd24fb0d6963f7d28e17f72"
}
Function core_md5 (K, f ){
K [F> 5] | = 128 <(f) % 32 );
K [(F + 64) >>> 9) <4) + 14] = F;
VaR J = 1732584193;
VaR I =-271733879;
VaR H =-1732584194;
VaR G = 271733878;
For (var c = 0; C <K. length; C + = 16 ){
VaR E = J;
VaR d = I;
VaR B = h;
VaR A = g;
J = md5_ff (J, I, H, G, K [C + 0], 7,-680876936 );
G = md5_ff (G, J, I, H, K [C + 1], 12,-389564586 );
H = md5_ff (H, G, J, I, K [C + 2], 17,606 105819 );
I = md5_ff (I, H, G, J, K [C + 3], 22,-1044525330 );
J = md5_ff (J, I, H, G, K [C + 4], 7,-176418897 );
G = md5_ff (G, J, I, H, K [C + 5], 12,120 0080426 );
H = md5_ff (H, G, J, I, K [C + 6], 17,- 1473231341 );
I = md5_ff (I, H, G, J, K [C + 7], 22,-45705983 );
J = md5_ff (J, I, H, G, K [C + 8], 7, 1770035416 );
G = md5_ff (G, J, I, H, K [C + 9], 12,-1958414417 );
H = md5_ff (H, G, J, I, K [C + 10], 17,- 42063 );
I = md5_ff (I, H, G, J, K [C + 11], 22,-1990404162 );
J = md5_ff (J, I, H, G, K [C + 12], 7, 1804603682 );
G = md5_ff (G, J, I, H, K [C + 13], 12,-40341101 );
H = md5_ff (H, G, J, I, K [C + 14], 17,- 1502002290 );
I = md5_ff (I, H, G, J, K [C + 15], 22,123 6521329 );
J = md5_gg (J, I, H, G, K [C + 1], 5,-165796510 );
G = md5_gg (G, J, I, H, K [C + 6], 9,-1069501632 );
H = md5_gg (H, G, J, I, K [C + 11], 14,643 717713 );
I = md5_gg (I, H, G, J, K [C + 0], 20,-373897302 );
J = md5_gg (J, I, H, G, K [C + 5], 5,-701558691 );
G = md5_gg (G, J, I, H, K [C + 10], 9, 38016083 );
H = md5_gg (H, G, J, I, K [C + 15], 14,-660478335 );
I = md5_gg (I, H, G, J, K [C + 4], 20,- 405537848 );
J = md5_gg (J, I, H, G, K [C + 9], 5, 568446438 );
G = md5_gg (G, J, I, H, K [C + 14], 9,-1019803690 );
H = md5_gg (H, G, J, I, K [C + 3], 14,-187363961 );
I = md5_gg (I, H, G, J, K [C + 8], 20,116 running 1501 );
J = md5_gg (J, I, H, G, K [C + 13], 5,-1444681467 );
G = md5_gg (G, J, I, H, K [C + 2], 9,-51403784 );
H = md5_gg (H, G, J, I, K [C + 7], 14,173 5328473 );
I = md5_gg (I, H, G, J, K [C + 12], 20,-1926607734 );
J = md5_hh (J, I, H, G, K [C + 5], 4,-378558 );
G = md5_hh (G, J, I, H, K [C + 8], 11,-2022574463 );
H = md5_hh (H, G, J, I, K [C + 11], 16,183 9030133 );
I = md5_hh (I, H, G, J, K [C + 14], 23,-35309556 );
J = md5_hh (J, I, H, G, K [C + 1], 4,-1530992060 );
G = md5_hh (G, J, I, H, K [C + 4], 11,127 2893353 );
H = md5_hh (H, G, J, I, K [C + 7], 16,-155497632 );
I = md5_hh (I, H, G, J, K [C + 10], 23,-1094730640 );
J = md5_hh (J, I, H, G, K [C + 13], 4, 681279174 );
G = md5_hh (G, J, I, H, K [C + 0], 11,-358537222 );
H = md5_hh (H, G, J, I, K [C + 3], 16,-722521979 );
I = md5_hh (I, H, G, J, K [C + 6], 23,760 29189 );
J = md5_hh (J, I, H, G, K [C + 9], 4,-640364487 );
G = md5_hh (G, J, I, H, K [C + 12], 11,-421815835 );
H = md5_hh (H, G, J, I, K [C + 15], 16,530 742520 );
I = md5_hh (I, H, G, J, K [C + 2], 23,-995338651 );
J = md5_ii (J, I, H, G, K [C + 0], 6,-198630844 );
G = md5_ii (G, J, I, H, K [C + 7], 10,112 6891415 );
H = md5_ii (H, G, J, I, K [C + 14], 15,-1416354905 );
I = md5_ii (I, H, G, J, K [C + 5], 21,-57434055 );
J = md5_ii (J, I, H, G, K [C + 12], 6, 1700485571 );
G = md5_ii (G, J, I, H, K [C + 3], 10,-1894986606 );
H = md5_ii (H, G, J, I, K [C + 10], 15,-1051523 );
I = md5_ii (I, H, G, J, K [C + 1], 21,-2054922799 );
J = md5_ii (J, I, H, G, K [C + 8], 6, 1873313359 );
G = md5_ii (G, J, I, H, K [C + 15], 10,-30611744 );
H = md5_ii (H, G, J, I, K [C + 6], 15,-1560198380 );
I = md5_ii (I, H, G, J, K [C + 13], 21,130 9151649 );
J = md5_ii (J, I, H, G, K [C + 4], 6,-145523070 );
G = md5_ii (G, J, I, H, K [C + 11], 10,-1120210379 );
H = md5_ii (H, G, J, I, K [C + 2], 15,718 787259 );
I = md5_ii (I, H, G, J, K [C + 9], 21,-343485551 );
J = safe_add (J, e );
I = safe_add (I, d );
H = safe_add (H, B );
G = safe_add (G,)
}
If (mode = 16 ){
Return array (I, H)
}
Else {
Return array (J, I, H, g)
}
}
Function md5_cen (F, C, B, A, E, D ){
Return safe_add (bit_rol (safe_add (C, F), safe_add (A, D), E), B)
}
Function md5_ff (C, B, G, F, A, E, D ){
Return md5_cen (B & G) | ((~ B) & F), C, B, A, E, D)
}
Function md5_gg (C, B, G, F, A, E, D ){
Return md5_cen (B & F) | (G &(~ F), C, B, A, E, D)
}
Function md5_hh (C, B, G, F, A, E, D ){
Return md5_cen (B ^ G ^ F, C, B, A, E, D)
}
Function md5_ii (C, B, G, F, A, E, D ){
Return md5_cen (G ^ (B | (~ F), C, B, A, E, D)
}
Function core_hmac_md5 (C, F ){
VaR E = str2binl (C );
If (E. length> 16 ){
E = core_md5 (E, C. length * chrsz)
}
VaR A = array (16), D = array (16 );
For (VAR B = 0; B <16; B ++ ){
A [B] = E [B] ^909522486;
D [B] = E [B] ^1549556828
}
VaR G = core_md5 (A. Concat (str2binl (f), 512 + F. length * chrsz );
Return core_md5 (D. Concat (G), 512 + 128)
}
Function safe_add (a, d ){
VaR c = (A & 65535) + (D & 65535 );
VaR B = (A> 16) + (D> 16) + (C> 16 );
Return (B <16) | (C & 65535)
}
Function bit_rol (a, B ){
Return (A <B) | (A >>> (32-B ))
}
Function str2binl (d) {// here it is.
VaR c = array ();
VaR A = (1 <chrsz)-1;
// 1 shifts 8 digits to the left minus 1, and A is equal to 0x0000 0001 0000 0000-1 = 0x0000 0000 1111 1111
For (VAR B = 0; B <D. length * chrsz; B + = chrsz) {// The length of D is the number of cycles, and the increment of B is 8
C [B> 5] | = (D. charcodeat (B/chrsz) & A) <(B % 32)
// Convert each character to Unicode, take the last eight digits, and shift left. In the C array, the values are shifted to the right by five digits, that is, the values 0, 8, and 16 are all C [0].
// The fourth character is the second character, and the first character is compressed into the first three or, 31 ---- All 0----24 23 ---- original third character ---- 16
// 15 ---- original second digit --- 8 7 ---- original first digit ---- 0 C string compresses the first three digits
}
Return C
}
Function binl2str (c ){
VaR d = "";
VaR A = (1 <chrsz)-1;
For (VAR B = 0; B <C. length * 32; B + = chrsz ){
D + = string. fromcharcode (C [B> 5] >>> (B % 32) &)
}
Return d
}
Function binl2hex (c ){
VaR B = hexcase? "0123456789 abcdef": "0123456789 abcdef ";
VaR d = "";
For (VAR a = 0; A <C. length * 4; A ++ ){
D + = B. charat (C [A> 2]> (a % 4) * 8 + 4) & 15) + B. charat (C [A> 2]> (a % 4) * 8) & 15)
}
Return d
}
Function binl2b64 (d ){
VaR c = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789 + /";
VaR F = "";
For (VAR B = 0; B <D. length * 4; B + = 3 ){
VaR E = (d [B> 2]> 8 * (B % 4) & 255) <16) | (d [B + 1> 2]> 8 * (B + 1) % 4) & 255) <8) | (d [B + 2> 2]> 8 * (B + 2) % 4) & 255 );
For (VAR a = 0; A <4; A ++ ){
If (B * 8 + A * 6> D. length * 32 ){
F + = b64pad
}
Else {
F + = C. charat (E> 6 * (3-a) & 63)
}
}
}
Return F
};
Complicated password conversion. We can see cyclic shift operations everywhere, and we are dizzy.