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"); this.flag = (TextView) findViewById(C0096R.C0099id.flag); final String vector2 = (String) confusion("reversehavemagic"); 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")); }
|
md5加密方法(此处输出的是32位小写)
1 2 3 4 5 6 7 8 9 10
| public static Object confusion(String str) { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(str.getBytes()); 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(); SecretKeySpec skeySpec = new SecretKeySpec(raw, type); Cipher cipher = Cipher.getInstance(CBC_PKCS5_PADDING); IvParameterSpec iv = new IvParameterSpec(mstrIvParameter.getBytes()); cipher.init(1, skeySpec, iv); byte[] cipherText = cipher.doFinal(strClearText.getBytes()); String strBase64Content = Base64.encodeToString(cipherText, 0); 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}