分享

AAuto QQ 密码 新算法

 看见就非常 2013-03-19

AAuto QQ 密码 新算法

子峰 发布于 2013年03月05日 18时, 24评/6417阅
不需要调用携带JS ,直接用AAuto源码实现QQ密码加密 原来算法代码参照 JS 思路 

补充:9楼 优化后的代码
标签: AAuto Quicker

代码片段(2)

[代码] AAuto

01// 9楼高手优化后的代码 用到了aauto开源的加密库 几行代码搞定
02 
03import crypt;
04import crypt.bin;
05import console;
06 
07uin2hex=function(str) {  
08    var hex = string.right( tostring( tonumber(str,10) ,16)  ,-3) 
09    hex = string.repeat(16 - #hex,"0") ++ hex;
10    return crypt.bin.decodeHex(hex) 
11
12 
13getEncryption=function(password, qq, vcode) { 
14    var str1 = crypt.bin.decodeHex(crypt.md5(password));
15    var str2 = crypt.md5(str1 + uin2hex(qq) );  
16    return crypt.md5(str2 + string.upper(vcode)); 
17}
18 
19enpass = getEncryption("hello","99808099",'!GVT')
20console.log( enpass )

[代码] AAuto

01// 原来代码 参照腾讯 JS 思路
02 
03import string.md5
04 
05uin2hex=function(str) {
06    var maxLength = 16;
07    var str=tonumber(str,10)
08    var hex = tostring(str,16)
09    var hex=string.sub(hex,3,#hex)
10    for ( i = #hex; maxLength-1;1) {
11        hex = "0" + hex
12    }
13    var arr = {};
14    for ( j = 1; maxLength;2) {
15        table.push(arr,"\x" + string.sub(hex,j,j+1))
16    }
17    var result =string.join(arr,"");
18    result=eval("'"+result + "'");
19    return result
20}
21 
22hexchar2bin=function(str) {
23    var arr = {}
24    for (i =1;#str;2) {
25        table.push(arr,"\x" + string.sub(str,i,i+1))
26    }
27    var arr = string.join(arr,"");
28    temp=eval("'"+arr+"'")
29    return temp
30}
31 
32getEncryption=function(password, qq, vcode) {
33    var uin=uin2hex(qq)
34    var str1 = hexchar2bin(string.md5(password));
35    var str2 = string.md5(str1 + uin);
36    var str3 = string.md5(str2 + string.upper(vcode));
37    return str3
38}
39 
40enpass=getEncryption(pass,qq,vcode) //uin 是 QQ 经过 uin2hex 运算得到的
41 
42io.open()
43io.print(enpass)

开源中国-程序员在线工具:API文档大全(120+) JS在线编辑演示 二维码 更多?

发表评论 回到顶部网友评论(24)

  • 1楼:notishell 发表于 2013-03-06 10:02 回复此评论
    现在都用身份认证了
  • 2楼:子峰 发表于 2013-03-06 17:51 回复此评论

    引用来自“notishell”的评论

    现在都用身份认证了
    啥?你没看懂代码? 这是最新的 QQ 密码 加密 的算法
  • 3楼:notishell 发表于 2013-03-06 18:22 回复此评论

    引用来自“子峰”的评论

    引用来自“notishell”的评论

    现在都用身份认证了
    啥?你没看懂代码? 这是最新的 QQ 密码 加密 的算法
    加密的思想跟身份认证类似
  • 4楼:子峰 发表于 2013-03-06 19:21 回复此评论

    引用来自“notishell”的评论

    引用来自“子峰”的评论

    引用来自“notishell”的评论

    现在都用身份认证了
    啥?你没看懂代码? 这是最新的 QQ 密码 加密 的算法
    加密的思想跟身份认证类似
    错看成身份证
  • 5楼:紫薯饼 发表于 2013-03-07 10:43 回复此评论
    以前是 md5(md5(密码)); 
    请问你的vcode从哪里来?
  • 6楼:子峰 发表于 2013-03-07 16:25 回复此评论

    引用来自“紫薯饼”的评论

    以前是 md5(md5(密码)); 
    请问你的vcode从哪里来?
    vcode 是验证码
  • 7楼:猪圈 发表于 2013-03-08 12:06 回复此评论
    弱爆了,还是让我来给大伙发福利吧 ~ 

    package org.chinasb.utils; 


    import java.io.ByteArrayOutputStream; 
    import java.io.UnsupportedEncodingException; 
    import java.security.MessageDigest; 


    public class TXMD5Utils { 
        public static final String HEXSTRING = "0123456789ABCDEF"; 


        public static String md5(String originalText) throws Exception { 
            byte buf[] = originalText.getBytes("ISO-8859-1"); 
            StringBuffer hexString = new StringBuffer(); 
            String result = ""; 
            String digit = ""; 
            try { 
                MessageDigest algorithm = MessageDigest.getInstance("MD5"); 
                algorithm.reset(); 
                algorithm.update(buf); 
                byte[] digest = algorithm.digest(); 
                for (int i = 0; i < digest.length; i++) { 
                    digit = Integer.toHexString(0xFF & digest[i]); 
                    if (digit.length() == 1) { 
                        digit = "0" + digit; 
                    } 
                    hexString.append(digit); 
                } 
                result = hexString.toString(); 
            } catch (Exception ex) { 
                result = ""; 
            } 
            return result.toUpperCase(); 
        } 


        public static String hexchar2bin(String md5str) throws UnsupportedEncodingException { 
            ByteArrayOutputStream baos = new ByteArrayOutputStream(md5str.length() / 2); 
            for (int i = 0; i < md5str.length(); i = i + 2) { 
                baos.write((HEXSTRING.indexOf(md5str.charAt(i)) << 4 | HEXSTRING.indexOf(md5str.charAt(i + 1)))); 
            } 
            return new String(baos.toByteArray(), "ISO-8859-1"); 
        } 


        /** 
         *  
         * @param qq http://check.ptlogin2.qq.com/check?uin={0}&appid=15000101&r={1} 返回的第三个值 
         * @param password QQ密码 
         * @param verifycode 验证码 
         * @return 加密后的密码 
         * @throws UnsupportedEncodingException 
         * @throws Exception 
         */ 
        public static String getPassword(String qq, String password, String verifycode) throws Exception { 
            String P = hexchar2bin(md5(password)); 
            String U = md5(P + hexchar2bin(qq.replace("\\x", "").toUpperCase())); 
            String V = md5(U + verifycode.toUpperCase()); 
            return V; 
        } 


        public static void main(String[] args) throws Exception { 
            System.out.println(getPassword("\\x00\\x00\\x00\\x00\\x03\\x7b\\xab\\x09", "zhujuan", "FPDS")); 
        } 



  • 8楼:滔哥 发表于 2013-03-08 14:48 回复此评论
    难道不是明文的吗?
  • 9楼:figer1 发表于 2013-03-08 16:05 回复此评论
    AAuto其实不需要写这么复杂,几句代码就可以搞定了,供楼主参考:  

    import crypt; 
    import crypt.bin; 
    import console; 


    uin2hex=function(str) {   
        var hex = string.right( tostring( tonumber(str,10) ,16)  ,-3)  
        hex = string.repeat(16 - #hex,"0") + hex; 
        return crypt.bin.decodeHex(hex)  
    }  


    getEncryption=function(password, qq, vcode) {  
        var str1 = crypt.bin.decodeHex(crypt.md5(password)); 
        var str2 = crypt.md5(str1 + uin2hex(qq) );   
        return crypt.md5(str2 + string.upper(vcode));  



    enpass = getEncryption("hello","99808099",'!GVT') 
    console.log( enpass )  

  • 10楼:figer1 发表于 2013-03-08 16:34 回复此评论
    上面"99808099" 就是QQ号码,
    @猪圈 的代码并没有包含UIN的转换算法 - 而是直接写在参数里了。
  • 11楼:子峰 发表于 2013-03-08 18:45 回复此评论
    已补充9楼优化后的代码
  • 12楼:子峰 发表于 2013-03-08 18:47 回复此评论

    引用来自“猪圈”的评论

    弱爆了,还是让我来给大伙发福利吧 ~ 

    package org.chinasb.utils; 


    import java.io.ByteArrayOutputStream; 
    import java.io.UnsupportedEncodingException; 
    import java.security.MessageDigest; 


    public class TXMD5Utils { 
        public static final String HEXSTRING = "0123456789ABCDEF"; 


        public static String md5(String originalText) throws Exception { 
            byte buf[] = originalText.getBytes("ISO-8859-1"); 
            StringBuffer hexString = new StringBuffer(); 
            String result = ""; 
            String digit = ""; 
            try { 
                MessageDigest algorithm = MessageDigest.getInstance("MD5"); 
                algorithm.reset(); 
                algorithm.update(buf); 
                byte[] digest = algorithm.digest(); 
                for (int i = 0; i < digest.length; i++) { 
                    digit = Integer.toHexString(0xFF & digest[i]); 
                    if (digit.length() == 1) { 
                        digit = "0" + digit; 
                    } 
                    hexString.append(digit); 
                } 
                result = hexString.toString(); 
            } catch (Exception ex) { 
                result = ""; 
            } 
            return result.toUpperCase(); 
        } 


        public static String hexchar2bin(String md5str) throws UnsupportedEncodingException { 
            ByteArrayOutputStream baos = new ByteArrayOutputStream(md5str.length() / 2); 
            for (int i = 0; i < md5str.length(); i = i + 2) { 
                baos.write((HEXSTRING.indexOf(md5str.charAt(i)) << 4 | HEXSTRING.indexOf(md5str.charAt(i + 1)))); 
            } 
            return new String(baos.toByteArray(), "ISO-8859-1"); 
        } 


        /** 
         *  
         * @param qq http://check.ptlogin2.qq.com/check?uin={0}&appid=15000101&r={1} 返回的第三个值 
         * @param password QQ密码 
         * @param verifycode 验证码 
         * @return 加密后的密码 
         * @throws UnsupportedEncodingException 
         * @throws Exception 
         */ 
        public static String getPassword(String qq, String password, String verifycode) throws Exception { 
            String P = hexchar2bin(md5(password)); 
            String U = md5(P + hexchar2bin(qq.replace("\\x", "").toUpperCase())); 
            String V = md5(U + verifycode.toUpperCase()); 
            return V; 
        } 


        public static void main(String[] args) throws Exception { 
            System.out.println(getPassword("\\x00\\x00\\x00\\x00\\x03\\x7b\\xab\\x09", "zhujuan", "FPDS")); 
        } 



    互相学习
  • 13楼:ljtnine 发表于 2013-03-08 22:50 回复此评论

    引用来自“figer1”的评论

    AAuto其实不需要写这么复杂,几句代码就可以搞定了,供楼主参考:  

    import crypt; 
    import crypt.bin; 
    import console; 


    uin2hex=function(str) {   
        var hex = string.right( tostring( tonumber(str,10) ,16)  ,-3)  
        hex = string.repeat(16 - #hex,"0") + hex; 
        return crypt.bin.decodeHex(hex)  
    }  


    getEncryption=function(password, qq, vcode) {  
        var str1 = crypt.bin.decodeHex(crypt.md5(password)); 
        var str2 = crypt.md5(str1 + uin2hex(qq) );   
        return crypt.md5(str2 + string.upper(vcode));  



    enpass = getEncryption("hello","99808099",'!GVT') 
    console.log( enpass )  

    代码很精简
  • 14楼:lemonseed 发表于 2013-03-09 12:52 回复此评论

    引用来自“猪圈”的评论

    弱爆了,还是让我来给大伙发福利吧 ~ 

    package org.chinasb.utils; 


    import java.io.ByteArrayOutputStream; 
    import java.io.UnsupportedEncodingException; 
    import java.security.MessageDigest; 


    public class TXMD5Utils { 
        public static final String HEXSTRING = "0123456789ABCDEF"; 


        public static String md5(String originalText) throws Exception { 
            byte buf[] = originalText.getBytes("ISO-8859-1"); 
            StringBuffer hexString = new StringBuffer(); 
            String result = ""; 
            String digit = ""; 
            try { 
                MessageDigest algorithm = MessageDigest.getInstance("MD5"); 
                algorithm.reset(); 
                algorithm.update(buf); 
                byte[] digest = algorithm.digest(); 
                for (int i = 0; i < digest.length; i++) { 
                    digit = Integer.toHexString(0xFF & digest[i]); 
                    if (digit.length() == 1) { 
                        digit = "0" + digit; 
                    } 
                    hexString.append(digit); 
                } 
                result = hexString.toString(); 
            } catch (Exception ex) { 
                result = ""; 
            } 
            return result.toUpperCase(); 
        } 


        public static String hexchar2bin(String md5str) throws UnsupportedEncodingException { 
            ByteArrayOutputStream baos = new ByteArrayOutputStream(md5str.length() / 2); 
            for (int i = 0; i < md5str.length(); i = i + 2) { 
                baos.write((HEXSTRING.indexOf(md5str.charAt(i)) << 4 | HEXSTRING.indexOf(md5str.charAt(i + 1)))); 
            } 
            return new String(baos.toByteArray(), "ISO-8859-1"); 
        } 


        /** 
         *  
         * @param qq http://check.ptlogin2.qq.com/check?uin={0}&appid=15000101&r={1} 返回的第三个值 
         * @param password QQ密码 
         * @param verifycode 验证码 
         * @return 加密后的密码 
         * @throws UnsupportedEncodingException 
         * @throws Exception 
         */ 
        public static String getPassword(String qq, String password, String verifycode) throws Exception { 
            String P = hexchar2bin(md5(password)); 
            String U = md5(P + hexchar2bin(qq.replace("\\x", "").toUpperCase())); 
            String V = md5(U + verifycode.toUpperCase()); 
            return V; 
        } 


        public static void main(String[] args) throws Exception { 
            System.out.println(getPassword("\\x00\\x00\\x00\\x00\\x03\\x7b\\xab\\x09", "zhujuan", "FPDS")); 
        } 



    我X,猪圈?乙文兄???
  • 15楼:JSON.org.cn 发表于 2013-03-09 19:40 回复此评论
    QQ的密码加密算, 就是这样的?
  • 16楼:猪圈 发表于 2013-03-10 01:26 回复此评论

    引用来自“lemonseed”的评论

    引用来自“猪圈”的评论

    弱爆了,还是让我来给大伙发福利吧 ~ 

    package org.chinasb.utils; 


    import java.io.ByteArrayOutputStream; 
    import java.io.UnsupportedEncodingException; 
    import java.security.MessageDigest; 


    public class TXMD5Utils { 
        public static final String HEXSTRING = "0123456789ABCDEF"; 


        public static String md5(String originalText) throws Exception { 
            byte buf[] = originalText.getBytes("ISO-8859-1"); 
            StringBuffer hexString = new StringBuffer(); 
            String result = ""; 
            String digit = ""; 
            try { 
                MessageDigest algorithm = MessageDigest.getInstance("MD5"); 
                algorithm.reset(); 
                algorithm.update(buf); 
                byte[] digest = algorithm.digest(); 
                for (int i = 0; i < digest.length; i++) { 
                    digit = Integer.toHexString(0xFF & digest[i]); 
                    if (digit.length() == 1) { 
                        digit = "0" + digit; 
                    } 
                    hexString.append(digit); 
                } 
                result = hexString.toString(); 
            } catch (Exception ex) { 
                result = ""; 
            } 
            return result.toUpperCase(); 
        } 


        public static String hexchar2bin(String md5str) throws UnsupportedEncodingException { 
            ByteArrayOutputStream baos = new ByteArrayOutputStream(md5str.length() / 2); 
            for (int i = 0; i < md5str.length(); i = i + 2) { 
                baos.write((HEXSTRING.indexOf(md5str.charAt(i)) << 4 | HEXSTRING.indexOf(md5str.charAt(i + 1)))); 
            } 
            return new String(baos.toByteArray(), "ISO-8859-1"); 
        } 


        /** 
         *  
         * @param qq http://check.ptlogin2.qq.com/check?uin={0}&appid=15000101&r={1} 返回的第三个值 
         * @param password QQ密码 
         * @param verifycode 验证码 
         * @return 加密后的密码 
         * @throws UnsupportedEncodingException 
         * @throws Exception 
         */ 
        public static String getPassword(String qq, String password, String verifycode) throws Exception { 
            String P = hexchar2bin(md5(password)); 
            String U = md5(P + hexchar2bin(qq.replace("\\x", "").toUpperCase())); 
            String V = md5(U + verifycode.toUpperCase()); 
            return V; 
        } 


        public static void main(String[] args) throws Exception { 
            System.out.println(getPassword("\\x00\\x00\\x00\\x00\\x03\\x7b\\xab\\x09", "zhujuan", "FPDS")); 
        } 



    我X,猪圈?乙文兄???
    尼妹啊,居然直呼大名。。。。老康兄~
  • 17楼:子峰 发表于 2013-03-10 12:58 回复此评论

    引用来自“JSON.org.cn”的评论

    QQ的密码加密算, 就是这样的?
    验算登陆成功
  • 18楼:lemonseed 发表于 2013-03-10 20:32 回复此评论

    引用来自“猪圈”的评论

    引用来自“lemonseed”的评论

    引用来自“猪圈”的评论

    弱爆了,还是让我来给大伙发福利吧 ~ 

    package org.chinasb.utils; 


    import java.io.ByteArrayOutputStream; 
    import java.io.UnsupportedEncodingException; 
    import java.security.MessageDigest; 


    public class TXMD5Utils { 
        public static final String HEXSTRING = "0123456789ABCDEF"; 


        public static String md5(String originalText) throws Exception { 
            byte buf[] = originalText.getBytes("ISO-8859-1"); 
            StringBuffer hexString = new StringBuffer(); 
            String result = ""; 
            String digit = ""; 
            try { 
                MessageDigest algorithm = MessageDigest.getInstance("MD5"); 
                algorithm.reset(); 
                algorithm.update(buf); 
                byte[] digest = algorithm.digest(); 
                for (int i = 0; i < digest.length; i++) { 
                    digit = Integer.toHexString(0xFF & digest[i]); 
                    if (digit.length() == 1) { 
                        digit = "0" + digit; 
                    } 
                    hexString.append(digit); 
                } 
                result = hexString.toString(); 
            } catch (Exception ex) { 
                result = ""; 
            } 
            return result.toUpperCase(); 
        } 


        public static String hexchar2bin(String md5str) throws UnsupportedEncodingException { 
            ByteArrayOutputStream baos = new ByteArrayOutputStream(md5str.length() / 2); 
            for (int i = 0; i < md5str.length(); i = i + 2) { 
                baos.write((HEXSTRING.indexOf(md5str.charAt(i)) << 4 | HEXSTRING.indexOf(md5str.charAt(i + 1)))); 
            } 
            return new String(baos.toByteArray(), "ISO-8859-1"); 
        } 


        /** 
         *  
         * @param qq http://check.ptlogin2.qq.com/check?uin={0}&appid=15000101&r={1} 返回的第三个值 
         * @param password QQ密码 
         * @param verifycode 验证码 
         * @return 加密后的密码 
         * @throws UnsupportedEncodingException 
         * @throws Exception 
         */ 
        public static String getPassword(String qq, String password, String verifycode) throws Exception { 
            String P = hexchar2bin(md5(password)); 
            String U = md5(P + hexchar2bin(qq.replace("\\x", "").toUpperCase())); 
            String V = md5(U + verifycode.toUpperCase()); 
            return V; 
        } 


        public static void main(String[] args) throws Exception { 
            System.out.println(getPassword("\\x00\\x00\\x00\\x00\\x03\\x7b\\xab\\x09", "zhujuan", "FPDS")); 
        } 



    我X,猪圈?乙文兄???
    尼妹啊,居然直呼大名。。。。老康兄~
    我X,猿粪呀。。。
  • 19楼:88250 发表于 2013-03-11 10:07 回复此评论

    引用来自“lemonseed”的评论

    引用来自“猪圈”的评论

    引用来自“lemonseed”的评论

    引用来自“猪圈”的评论

    弱爆了,还是让我来给大伙发福利吧 ~ 

    package org.chinasb.utils; 


    import java.io.ByteArrayOutputStream; 
    import java.io.UnsupportedEncodingException; 
    import java.security.MessageDigest; 


    public class TXMD5Utils { 
        public static final String HEXSTRING = "0123456789ABCDEF"; 


        public static String md5(String originalText) throws Exception { 
            byte buf[] = originalText.getBytes("ISO-8859-1"); 
            StringBuffer hexString = new StringBuffer(); 
            String result = ""; 
            String digit = ""; 
            try { 
                MessageDigest algorithm = MessageDigest.getInstance("MD5"); 
                algorithm.reset(); 
                algorithm.update(buf); 
                byte[] digest = algorithm.digest(); 
                for (int i = 0; i < digest.length; i++) { 
                    digit = Integer.toHexString(0xFF & digest[i]); 
                    if (digit.length() == 1) { 
                        digit = "0" + digit; 
                    } 
                    hexString.append(digit); 
                } 
                result = hexString.toString(); 
            } catch (Exception ex) { 
                result = ""; 
            } 
            return result.toUpperCase(); 
        } 


        public static String hexchar2bin(String md5str) throws UnsupportedEncodingException { 
            ByteArrayOutputStream baos = new ByteArrayOutputStream(md5str.length() / 2); 
            for (int i = 0; i < md5str.length(); i = i + 2) { 
                baos.write((HEXSTRING.indexOf(md5str.charAt(i)) << 4 | HEXSTRING.indexOf(md5str.charAt(i + 1)))); 
            } 
            return new String(baos.toByteArray(), "ISO-8859-1"); 
        } 


        /** 
         *  
         * @param qq http://check.ptlogin2.qq.com/check?uin={0}&appid=15000101&r={1} 返回的第三个值 
         * @param password QQ密码 
         * @param verifycode 验证码 
         * @return 加密后的密码 
         * @throws UnsupportedEncodingException 
         * @throws Exception 
         */ 
        public static String getPassword(String qq, String password, String verifycode) throws Exception { 
            String P = hexchar2bin(md5(password)); 
            String U = md5(P + hexchar2bin(qq.replace("\\x", "").toUpperCase())); 
            String V = md5(U + verifycode.toUpperCase()); 
            return V; 
        } 


        public static void main(String[] args) throws Exception { 
            System.out.println(getPassword("\\x00\\x00\\x00\\x00\\x03\\x7b\\xab\\x09", "zhujuan", "FPDS")); 
        } 



    我X,猪圈?乙文兄???
    尼妹啊,居然直呼大名。。。。老康兄~
    我X,猿粪呀。。。
    @猪圈 你还有这闲情逸致啊。。。。
  • 20楼:lujjjh 发表于 2013-03-11 18:51 回复此评论
    第9行应当改为: 
    hex = string.repeat(16 -  #hex,"0") ++ hex; 
    否则如果 hex 是纯数字,AAuto 会理解为算数运算符。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约