Jump to content
Tuts 4 You

ConfuserEx 1.6.0


1 Screenshot

Public key sample protected using ConfuserEx 1.6.0.

https://github.com/mkaring/ConfuserEx/releases/tag/v1.6.0

Your challenge is to unpack and decompile the file.

using System;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.Drawing;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public static string pkey = "<DSAKeyValue><P>71IwROY7AbrMnNlE2lU97EnQbqAWqf17VvvpQ0vS58jH/xpCrE0F9GzOwUqtWz" +
            "5U5zRAJOF1o5rNndFgI+gz7ftRjpioqmWoikmjt/EXLh5DidCtl3ioW4T+7QxdFqxoNR+SFvwQxpLab00raG9ZlrNJC9NlNEmBOiLO1" +
            "YwTZD8=</P><Q>iju9V4G56FzWIBq3XB+WAeUMbNE=</Q><G>nmAiiLFu9KocDaLQ/7PyH4M3yhSDghXyUvPAk+frnHFOunGB59C+khf" +
            "4UFqrM88Gc3vTQ0emGHUQkQg41/zLcB6VDFYY7KXfq0lTkNVy/dDlKGyu8WeWLE5OZZnwYMqh5OHJpHvbNjTMazXVQ/hIlDBvzK2DSO" +
            "VHtlVNgIL4PLw=</G><Y>cZjXy7ZsACVEVfg6hgDTMqbaa6iSz6AEvFmlP9oVL745GlMW16nCpsvGlJ198C4CatVixv4dXJcSNWaLRCJ" +
            "U8P1K8xaSTYK+QIZRh4ROCqefUjgjIt8HsXayZGeN3fiRrffNyylx1N3oWy9r5pIeot+rM9g+8hvYsNJuk06pSZA=</Y><Seed>BTQt" +
            "V7avBykNVpqag6o2bPnuCyI=</Seed><PgenCounter>AS8=</PgenCounter></DSAKeyValue>";


        public Form1()
        {
            InitializeComponent();
        }
        private void changeText(bool type = false)
        {
            Label1.BackColor = Color.OrangeRed;
            Label1.Text = "..:: INVALID KEY !!! ::..";
            if (type)
            {
                Label1.BackColor = Color.GreenYellow;
                Label1.Text = "CORRECT";
            }
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            var dsa = new DSACryptoServiceProvider();
            dsa.FromXmlString(pkey);
            try
            {
                byte[] key = Enumerable.Range(0, TextBox2.Text.Length).Where(x => x % 2 == 0).Select(x => Convert.ToByte(TextBox2.Text.Substring(x, 2), 16)).ToArray();
                bool check = dsa.VerifyHash(HashAlgorithm.Create("SHA1").ComputeHash(Encoding.ASCII.GetBytes(TextBox1.Text)), CryptoConfig.MapNameToOID("SHA1"), key);
                this.changeText(check);
            }
            catch (Exception _)
            {
                changeText();
            }
        }

        private void Button2_Click(object sender, EventArgs e)
        {
            TextBox1.Clear();
            TextBox2.Clear();
            Label1.Text = "";
            Label1.BackColor = SystemColors.Control;
            TextBox1.Select();
        }

        private void button2_Click_1(object sender, EventArgs e)
        {
            var dsa = new DSACryptoServiceProvider();
            dsa.FromXmlString(pkey);
            try
            {
                textBox4.Text = Convert.ToString(dsa.SignData(Encoding.ASCII.GetBytes(TextBox1.Text)));
            } catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
    }
}

User Feedback

Recommended Comments

There are no comments to display.

×
×
  • Create New...