ez_baby_apk

runwu2204 Lv6

ez_baby_apk

主方法

1
2
3
4
5
6
7
8
9
10
11
12
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(C0096R.layout.activity_main);
final String key1 = "reversecarefully".replaceAll("e", "3");//将e换成3
this.flag = (TextView) findViewById(C0096R.C0099id.flag);
final String vector2 = (String) confusion("reversehavemagic");//对字符串进行md5加密
this.input_1 = (EditText) findViewById(C0096R.C0099id.input_1);
Button button = (Button) findViewById(C0096R.C0099id.button);
this.button = button;
button.setOnClickListener(new C00001(this, vector2, key1, "BxLHc1KruiH31I94W171oal+9olDzgBIjnK/J1Db0IUyi+MbI38+nw62ejCPShRB"));//此处为密文
}//注意其传参位置 vector才是key,key是偏移量

md5加密方法(此处输出的是32位小写)

1
2
3
4
5
6
7
8
9
10
public static Object confusion(String str) {
MessageDigest md = MessageDigest.getInstance("MD5"); // Catch: Exception -> L6
md.update(str.getBytes()); // Catch: Exception -> L6
return new BigInteger(1, md.digest()).toString(16);
L6:
e = move-exception;
e.printStackTrace();
return null;
}

DES加密方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public DES() {
}

public static String encrypt(String strKey, String strClearText, String mstrIvParameter) {
byte[] raw = strKey.getBytes(); // Catch: Exception -> L7
SecretKeySpec skeySpec = new SecretKeySpec(raw, type); // Catch: Exception -> L7
Cipher cipher = Cipher.getInstance(CBC_PKCS5_PADDING); // Catch: Exception -> L7
IvParameterSpec iv = new IvParameterSpec(mstrIvParameter.getBytes()); // Catch: Exception -> L7
cipher.init(1, skeySpec, iv); // Catch: Exception -> L7
byte[] cipherText = cipher.doFinal(strClearText.getBytes()); // Catch: Exception -> L7
String strBase64Content = Base64.encodeToString(cipherText, 0); // Catch: Exception -> L7
return strBase64Content.replaceAll(System.getProperty("line.separator"), "");
L7:
e = move-exception;
e.printStackTrace();
return null;
}

此处des使用的是CBC模式,pkcs5padding带有偏移量

1
2
3
4
5
密文"BxLHc1KruiH31I94W171oal+9olDzgBIjnK/J1Db0IUyi+MbI38+nw62ejCPShRB"

密码(String) confusion("reversehavemagic") 32位小写md5

偏移"reversecarefully".replaceAll("e", "3")

但我自己电脑复现出来是乱码,可以通过网上的解密工具进行解密

NKCTF{nI_k@i_sHi_zhu_j1an_il_Jie_RE_le}

  • 标题: ez_baby_apk
  • 作者: runwu2204
  • 创建于 : 2023-03-25 17:22:26
  • 更新于 : 2023-03-28 21:14:46
  • 链接: https://runwu2204.github.io/2023/03/25/CTF WP/Re/安卓/ez_baby_apk/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论
目录
ez_baby_apk