首页
社区
课程
招聘
[旧帖] [求助]RSA逆向,找私密,有没人帮手看看呢? 0.00雪花
发表于: 2014-12-10 16:58 1729

[旧帖] [求助]RSA逆向,找私密,有没人帮手看看呢? 0.00雪花

2014-12-10 16:58
1729
byte[]  localObject1 = new byte[ (int) localFile.length()];
//[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
      Object localObject2 = new FileInputStream(localFile);
      ((FileInputStream) localObject2).read((byte[]) localObject1);//读取文件
      ((FileInputStream) localObject2).close();
//[9, -31, 9, 49, -3, 12, -113, 7, 101, 20, 25, 42, 59, 117, -48, -117, 25, -59, 106, 36, -42, -76, 56, -78, 59, 113, 114, -105, -98, 85, -77, 82, -16, 78, 86, -86, 30, 28, -2, 39, 83, -21, 0, 32, 86, -71, -124, -114, 122, 64, -95, -79, -89, -17, -71, -35, -95, -10, 34, 103, 56, 95, 17, -70, 89, -1, -107, -22, 61, -86, 77, -31, -73, 112, 9, 44, -49, -125, 53, -9, 76, 61, 115, -94, 90, -21, 65, -59, 122, -76, -36, -91, 88, -1, 51, -90, -90, -118, 99, -128, 17, -109, -49, -41, -28, 111, 98, -19, -127, 86, -37, -87, 76, 88, 45, -93, 5, 95, -38, -111, 16, -49, 30, -72, -54, 3, 105, 101, 55, 19, 11, -29, -115, -41, -19, -69, 111, -27, -64, 96, -43, 71, -1, 82, 106, -116, -45, 51, 87, 17, -12, 118, -111, 125, -108, -112, 56, -36, -117, 113, 120, -115, 127, 1, 106, -49, 9, 48, -12, 38, 81, 20, -69, 44, 37, 81, 104, 30, -89, -71, 69, 63, -121, -12, 17, 108, -52, 37, 57, 125, -117, -84, -121, 19, -43, 73, -100, 99, -5, -17, 100, -84, -121, -69, -3, 19, -69, -101, -25, -127, -84, 124, 21, 113, 27, 48, -76, 76, 13, -19, -127, -103, -1, 17, -85, 46, -76, 114, 30, 40, -78, -62, 86, 59, -34, -89, 110, -58, -58, 14, -71, 21, -80, -33, 98, 4, -50, 121, -83, -21, -121, 50, -89, -51, 89, 117, 12, 119, -87, 88, -84, 19, -65, 51, -40, -61, -29, -51, -35, -82, 54, 51, -39, 126, 82, -70, 62, -128, 109, -121, -38, 116, 115, 71, 115, 74, -74, -96, -95, -48, -1, -92, 28, 36, -50, -47, 20, -115, 116, -20, 80, 75, 74, 27, 14, 97, 99, 102, 86, -51, -55, -38, 127, -20, 10, 52, -5, 126, 6, 0]
      //另一种加密方法
      byte[] localObject3 = {0, 65, 0, 3, 0, -113, -115, -38, -106, -26, -14, -81, 3, -112, -94, -22, 89, 37, 77, -6, 39, -29, 67, -82, -44, -103, 47, 21, 38, 71, -89, 72, 2, 89, -49, -19, 1, 110, 74, 68, -117, -28, 123, 107, 107, 92, 105, -5, 59, -23, 11, -107, -27, 36, -85, -22, 101, 82, -40, -108, 15, -103, 61, -39, 52, 28, 57, -28, 101, 1, 0, 1};
      int i = (localObject3[0] & 0xFF) << 8 | localObject3[1] & 0xFF;
      //65
      int j = (localObject3[2] & 0xFF) << 8 | localObject3[3] & 0xFF;
      //3
      byte[] arrayOfByte2 = new byte[i];
//[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
      byte[] arrayOfByte3 = new byte[j];
      //[0, 0, 0]
      System.arraycopy(localObject3, 4, arrayOfByte2, 0, i);
      //[0, -113, -115, -38, -106, -26, -14, -81, 3, -112, -94, -22, 89, 37, 77, -6, 39, -29, 67, -82, -44, -103, 47, 21, 38, 71, -89, 72, 2, 89, -49, -19, 1, 110, 74, 68, -117, -28, 123, 107, 107, 92, 105, -5, 59, -23, 11, -107, -27, 36, -85, -22, 101, 82, -40, -108, 15, -103, 61, -39, 52, 28, 57, -28, 101]
      System.arraycopy(localObject3, 4 + i, arrayOfByte3, 0, j);
      //[1, 0, 1]
      
      ////获取私钥的参数
      Object localObject4 = new BigInteger(1, arrayOfByte2);
//7518539155220091912091271151607171597180694736625285327722048871200906719085585230683358494079624676176505503892717301692809619039513418622614148430292069
      Object localObject5 = new BigInteger(1, arrayOfByte3);
//65537
      int m = (((BigInteger) localObject4).bitLength() + 7) / 8;//64 RSAPublicKey keysize
      int n = m;//64
      int i1 = m - 1;//63
      int i2 = (localObject1.length + n - 1) / n * i1;//(?+64-1)64*63=315
      byte[] arrayOfByte1 = new byte[i2];//315
      int i3 = 0;
      //循环
      for (int i4 = 0; i3 < localObject1.length;i4 += i1) 
      {
        byte[] arrayOfByte4 = new byte[n];
        int i5 = localObject1.length - i3;
        if (i5 > n) 
          System.arraycopy(localObject1, i3, arrayOfByte4, 0, n);
        else 
          System.arraycopy(localObject1, i3, arrayOfByte4, 0, i5);
        //
            BigInteger localBigInteger1 = new BigInteger(1, arrayOfByte4);
//517407651520686600069155755378994573441292672595621585940102495302888392538492833013031513124330161658548374683634860721799927620216002436239992782000570
          //解密明文 
            BigInteger localBigInteger2 = localBigInteger1.modPow((BigInteger) localObject5, (BigInteger) localObject4);
//9976971778203722047684271002989477961883238883022141389684090131454479278822236304571083126853114419726057531570923733312166778452205013214592459886091            
          //计算明文对应的字符串并输出。
            arrayOfByte4 = localBigInteger2.toByteArray();
            
//[48, -60, 52, 63, 1, -44, -69, -93, 0, -96, -98, -92, 123, 83, -12, 108, 110, -2, 0, 108, -20, 30, -111, -45, 112, -38, -1, -118, -13, -66, -49, 17, -27, 116, -124, -79, 93, 30, 83, -67, 0, 94, 100, 8, 112, 47, 0, -34, 127, -87, 1, -18, 100, -4, 29, -103, -118, 72, 77, -23, 0, 78, 11]
        if (arrayOfByte4.length <= i1) 
          System.arraycopy(arrayOfByte4, 0, arrayOfByte1, i4 + i1 - arrayOfByte4.length, arrayOfByte4.length);
        else 
          System.arraycopy(arrayOfByte4, arrayOfByte4.length - i1, arrayOfByte1, i4, i1);
            i3 += n;
      }
      i = arrayOfByte1[0] & 0xFF;//65
      j = arrayOfByte1[1] & 0xFF;//3
      arrayOfByte2 = new byte[i];
      //循环
      for (int k = 0; k < i; k++) {
        arrayOfByte2[k] = arrayOfByte1[j];
        j = arrayOfByte1[(j + 1)] & 0xFF;
      }
      //[48, -60, 52, 63, 1, -44, -69, -93, 0, -96, -98, -92, 123, 83, -12, 108, 110, -2, 0, 108, -20, 30, -111, -45, 112, -38, -1, -118, -13, -66, -49, 17, -27, 116, -124, -79, 93, 30, 83, -67, 0, 94, 100, 8, 112, 47, 0, -34, 127, -87, 1, -18, 100, -4, 29, -103, -118, 72, 77, -23, 0, 78, 11, -47, -44, 51, 74, -116, 118, -56, 28, -48, 99, -83, 107, -31, 22, 74, 0, -114, 0, 50, 36, -98, 65, -30, 97, 16, 42, 110, 0, -72, 7, 77, 0, 60, 8, -94, -103, -55, -115, 12, 3, -10, 48, 114, 7, 61, 15, -76, 105, -84, 27, 96, -105, 34, -48, 104, 37, -122, 113, -10, 112, -52, 62, 87, 79, -2, 110, 108, 123, 50, -1, 26, -112, 78, -86, 66, -1, 79, 26, -92, 0, -92, 127, 69, -108, 42, -32, -34, -58, 47, 101, 42, -95, 21, 29, 77, 57, -44, 0, 40, -44, 46, 10, -64, -55, 106, -3, -25, -99, -95, 99, -74, -6, -9, -114, 27, 10, 18, 65, 24, 47, -20, 120, -97, 36, 110, -1, -124, -80, -126, 0, 80, 0, 4, 0, 102, 15, -84, 69, 84, -31, 122, 121, 123, 98, -82, -40, 74, -88, 99, 109, -68, 97, 53, 36, 61, 117, -26, 10, 53, 0, -62, 68, -83, 83, 18, 63, -71, 115, 110, 40, -114, 68, -107, 65, 52, 67, 112, 3, -56, -4, 122, -67, -33, 0, -16, 5, 125, 22, -42, 118, 86, 99, -104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
      //序列化
      ByteArrayInputStream localByteArrayInputStream = new ByteArrayInputStream(arrayOfByte2);
      //[0, 3, 0, 3, 69, 65, 83, 0, 15, 65, 112, 117, 115, 105, 99, 47, 65, 100, 118, 97, 110, 99, 101, 100, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 1, 67, 27, 8, -44, 0, 0, 0, 1, 109, -1, -1, -1, -1]
      localObject4 = new DataInputStream(localByteArrayInputStream); 

[课程]Linux pwn 探索篇!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 150
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
看不懂 看不懂
2014-12-10 18:39
0
雪    币: 4
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
RSA私钥、公钥不会在同一个文件里出现吧?
2014-12-27 14:44
0
雪    币: 36
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
这是什么貌似你已经很厉害了
2014-12-27 21:12
0
雪    币: 234
活跃值: (54)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
你想干什么,RSA向量加密参数都在文件里面,获取出来 就可以加密了。
2014-12-27 21:56
0
游客
登录 | 注册 方可回帖
返回
//