資源共享吧|易語(yǔ)言論壇|逆向破解教程|輔助開發(fā)教程|網(wǎng)絡(luò)安全教程|m.anzei.cn|我的開發(fā)技術(shù)隨記

標(biāo)題: 請(qǐng)教一個(gè)問(wèn)題,反編譯后Java的這個(gè)循環(huán)分段加密 [打印本頁(yè)]

作者: qq2320087128    時(shí)間: 2020-9-10 16:53
標(biāo)題: 請(qǐng)教一個(gè)問(wèn)題,反編譯后Java的這個(gè)循環(huán)分段加密
搞了幾天了,還是有點(diǎn)不明白,這個(gè)是代碼

public static String encryptRsa(String arg5, String arg6) throws Exception {  
        int v1;
        ByteArrayOutputStream v2;
        Cipher v0 = Cipher.getInstance("RSA/ECB/PKCS1Padding");
        v0.init(1, WeiboIdTask.getPublicKey(arg6));  
        arg6 = "UTF-8";
        byte[] v5 = arg5.getBytes(arg6);
        try {
            v2 = new ByteArrayOutputStream();
            v1 = 0;
        }
        catch(Throwable v5_1) {
            v2 = ((ByteArrayOutputStream)v1);
            goto label_36;
        }

        while(true) {
            int v3 = 117;
            try {
                v3 = WeiboIdTask.splite(v5, v1, v3);
                if(v3 != -1) {
                    v2.write(v0.doFinal(v5, v1, v3));
                    v1 += v3;
                    continue;
                }

                v2.flush();
                String v0_1 = new String(Base64.encodebyte(v2.toByteArray()), arg6);
            }


    private static int splite(byte[] arg1, int arg2, int arg3) {
        if(arg2 >= arg1.length) {
            return -1;
        }

        return Math.min(arg1.length - arg2, arg3);
    }


//這是完整的加密明文一共長(zhǎng)度為360,上面那個(gè)循環(huán)就是處理這個(gè)明文
{"1":"Android 5.1.1","2":"865166028402405","3":"865166028402405","4":"460003648720333","5":"00:81:36:cc:7c:a9","6":"89860001116798046951","7":"0038a704","10":"9e5a19a004e6b36b","13":"armeabi-v7a","14":"Mi 10 Pro","15":"16776077312","16":"540*960","17":"\"korman\"","18":"Xiaomi","19":"wifi","20":"Xiaomi-Mi 10 Pro__weibosdk__0041005000__android__android5.1.1"}

//以下是我FD抓包的
TTN4Yh8a7dR6pTspmAPlsXj11jhnjSV/xIr3SP/H2HBjcyfCjgVq0+znZHnlZWsBH2IzF31cGmHKhW0AxmNmQ2V15P4HUj7SAQrnr1i++pPTSRC43/N15x1G1odWvBXXmGG9KF/FGOyem8W1jb/VC1410lC+5hWX9OkYSfQh20s1RCfDwqKqVX/XSivEgFkhJOfexDyXehyaVZPjzCwKuNwhwrQ5HGVXhIUeX/nvCD9cHoz9vJxKlAV9prAkQsnXUJnyJmhqRYkMqvL2R17TBP/KnrrXg3aleksu6G3RmyrWO0uWhjyYp/WnVIlLR3rvsjhu37DNuwYP+jB5zM7PsDQWsV/6klnMnw+3p5Hiy+QnM1K/LiQAMYCsRvgFSJTPomt9pN3KV9zuQ2OtKV2fb4uJi4UBqDhlk1+JTWwFLHl3QJ25F9I10jA5sHlJ41fyR4CuP7X7czcALWt55T9FNhwXxLZiaCuL0f58Y4TmKSD7XpG/JqyNSdQBiiZdti8TE/1H0VBU84P5kgamudAg6DS+mUHXbEFd+q744BP3LhiL1Ie5YoP0nexO4VqCCmI9lhnw+JYlQdUOTdx0mkOTjDyZkMjX/+cymn93tXlE0qN/lsS552fixnkXHQ5Fxjt+9bAtMJL+hrYTfwT8WocPPXC+/OPeLZIiJnBxlGkfcmU=

//以下是我Hook到的加密
{"1":"Android 5.1.1","2":"865166028402405","3":"865166028402405","4":"460003648720333","5":"00:81:36:cc:7c:a9","6":"8    第一段加密明文
TTN4Yh8a7dR6pTspmAPlsXj11jhnjSV/xIr3SP/H2HBjcyfCjgVq0+znZHnlZWsBH2IzF31cGmHKhW0AxmNmQ2V15P4HUj7SAQrnr1i++pPTSRC43/N15x1G1odWvBXXmGG9KF/FGOyem8W1jb/VC1410lC+5hWX9OkYSfQh20s=    Hook到的加密值

9860001116798046951","7":"0038a704","10":"9e5a19a004e6b36b","13":"armeabi-v7a","14":"Mi 10 Pro","15":"16776077312","1    第二段加密明文
WU6CjEbV33rgPLgUL+7fofaLNIWSxZW2N0w4PWMlG5V83Kp01EnSixUm6AXdcMD1KF5IVRGGHNpjE98xG4Z1XYSF0Xo0t407hmtYM5zVU9zDzbNCgcCqls4NnS6NVaHD2EW7ptgSCc3CP3oAuFB1sHmmeBiiXLvuCLjjVfLR87k=     Hook到的加密值

6":"540*960","17":"\"korman\"","18":"Xiaomi","19":"wifi","20":"Xiaomi-Mi 10 Pro__weibosdk__0041005000__android__andro    第三段加密明文
aovcx9s0Yxvk5j0FJWITKPEc5XSmayRFwRRIRs6nn93OlF0/2CEsImalcjT9EFeDGPDQggRZNdRJ9fUiUB1jJljb3ItwoLLejS6AbcPsVUoFYsGqH+s2a4hLPHdnAn1iyKYhqa03ielqGzqhv4BTmMzljMIXRy48PenoQ3dUPnw=    Hook到的加密值

id5.1.1"}    第四段加密明文
E/1H0VBU84P5kgamudAg6DS+mUHXbEFd+q744BP3LhiL1Ie5YoP0nexO4VqCCmI9lhnw+JYlQdUOTdx0mkOTjDyZkMjX/+cymn93tXlE0qN/lsS552fixnkXHQ5Fxjt+9bAtMJL+hrYTfwT8WocPPXC+/OPeLZIiJnBxlGkfcmU=    Hook到的加密值

其中第一個(gè)循環(huán)Hook到的加密值最后2位不對(duì)其他的對(duì)上了,第四個(gè)循環(huán)Hook到的加密值和抓包返回的全部對(duì)上了,第二個(gè)循環(huán)加密的和第三個(gè)循環(huán)加密的數(shù)據(jù)對(duì)不上

總長(zhǎng)度360
第一次循環(huán)是取前0-117
第二次循環(huán)是取117-234
第三次循環(huán)是取234-351
第四次循環(huán)是取351-360
然后分段加密拼接,F(xiàn)D抓包返回回來(lái)的密文長(zhǎng)度是684,我自己分段加密拼接是688,求大神指點(diǎn)。


這個(gè)是公鑰:MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHHM0Fi2Z6+QYKXqFUX2Cy6AaWq3cPi+GSn9oeAwQbPZR75JB7Netm0HtBVVbtPhzT7UO2p1JhFUKWqrqoYuAjkgMVPmA0sFrQohns5EE44Y86XQopD4ZO+dE5KjUZFE6vrPO3rWW3np2BqlgKpjnYZri6TJApmIpGcQg9/G/3zQIDAQAB

用的是RSA/ECB/PKCS1Padding加密







歡迎光臨 資源共享吧|易語(yǔ)言論壇|逆向破解教程|輔助開發(fā)教程|網(wǎng)絡(luò)安全教程|m.anzei.cn|我的開發(fā)技術(shù)隨記 (http://m.anzei.cn/) Powered by Discuz! X3.4