My Encrypting/Decrypting Program + challenge

The fear of every surveillance society: citizens protecting their own privacy with strong cryptography

Re: My Encrypting/Decrypting Program + challenge

Post by tgoe on Mon Feb 06, 2012 7:14 am
([msg=64144]see Re: My Encrypting/Decrypting Program + challenge[/msg])

Posting whit encryption when there is a decrypter in the very same thread would not be clever way to avoid moderation.

Sure it is. If you want to talk privately, use the pm system. It's also a way to get users to execute your binary on their machine. Now, I'm not accusing you of anything, but I also can't simply trust you (or any other user that posts a binary) either :) Posting trojans to the forum has been tried before.

I am total begginer, so please, be more educational.


Posting source code is a much better way to get feedback and is safer for users.
User avatar
tgoe
Contributor
Contributor
 
Posts: 642
Joined: Sun Sep 28, 2008 2:33 pm
Location: q3dm7
Blog: View Blog (0)


Re: My Encrypting/Decrypting Program + challenge

Post by learnzndy on Tue Feb 07, 2012 6:22 am
([msg=64166]see Re: My Encrypting/Decrypting Program + challenge[/msg])

@limdis
01 - Im glad that this is still a challenge, and gives someone chance to learn something.
6A04:43 - Thanks for that, i was trying to delete that line in Notepad and Notepad++ :lol: , but that would break the program, and make it notresponding, hexeditor is working fine. But ill not update link until i make some major change.
"tgoe might have found something else" - please tgoe, if you did, tell us, or pm me.

@tgoe
I just like, and keep getting money every time users execute my binary on their machine :D just kidding, You actualy got the point. I deleted original source code some months ago, but thanks to tucak, i was able to recover it, and here it is:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
    if ((DateTime.Now.Year > 0x7db) & (DateTime.Now.Month > 6))
    {
        this.Close();
    }
    this.mesec = (DateTime.Now.Month + DateTime.Now.Year) - 0x7d0;
    this.KeyArray[0] = "h9t bmzoy.2!k7ci?s18p5nwa4j3,qvl0fgeurxd6";
    this.KeyArray[1] = "fykn.vduit1xr0p4b,a5m!l2w?7j sco869ghz3qe";
    this.KeyArray[2] = "76k05mfgj,l8ap3c!ehwn?4vb1so .tqruixyz9d2";
    this.KeyArray[3] = "sug2f0bv 16t3iqyop8j7m4kdrnhlw.9?e,xa!c5z";
    this.KeyArray[4] = "ulej t!fmixqsgnaz3vrb.6h50wd1,pk82o7?c9y4";
    this.KeyArray[5] = "rnl7thby5.6mqdi!e zfc13sgj?8042u,9xvwaokp";
    this.KeyArray[6] = "h0uc,?sp7nemi25ft1gaowbz3xkqd!v9r. y48jl6";
    this.KeyArray[7] = ".qd90p,yn45gz!?jfoeluk7v6r8th1bxaicwms32 ";
    this.KeyArray[8] = "!wm.eqi5fvcngkl9tj3?s7yd6 0zu82h1pa,r4oxb";
    this.KeyArray[9] = "l16c0v?qjps9ixon8t5ru,ye!w7bh 4g.z2kd3amf";
    this.KeyArray[10] = "s?,jx87!fwbcd4nmoepih3ytv u052akrzlg9.16q";
    this.KeyArray[11] = "o?bi4kvxuezql, w1a.!5t7ghfmdjc2398py6sn0r";
    this.KeyArray[12] = "aln6o8k0cdj?53rt4mqx2fpiuz,s!1e bh9wvyg7.";
    this.KeyArray[13] = "v3imudq?8 0xspf9ocylrk426b1,wtghajz7n.!e5";
    this.KeyArray[14] = "gt,hje5xr6s.?o8!v3cqz2 bw0fm14ynkupil7a9d";
    this.KeyArray[15] = "dfwbal86ymj vpc40utk5!.re7zxh,os93?gn12qi";
    this.KeyArray[0x10] = "kmvorqtg2h!9.ba164c,7fpnsxw8u?d0ey5il j3z";
    this.KeyArray[0x11] = "c7yjsmwrgupze0?atvnf6!q8bid94 ox.h1l23k,5";
    this.KeyArray[0x12] = "cbp62k9vi0ho7rz8,ngx4syful!md3tj.qewa5?1 ";
    this.KeyArray[0x13] = "txmr9.l4a2f7p6zv8?swq0hgc3jnyduobki 1e5!,";
    this.KeyArray[20] = "8vo32df1zw jagh0q!6pmunr9bke5,4xt7s.y?cli";
    this.KeyArray[0x15] = "j?bnd yqvcm0785z6rawl!igts2x1,4eoh39upk.f";
    this.KeyArray[0x16] = " u.nq09ygp?o8wr24c!zvaletj,6m1b3khd7sx5if";
    this.KeyArray[0x17] = "v6f75brgapoq3zmh984,!slu? eiyn.1wdxkjt2c0";
    this.KeyArray[0x18] = "ved86hmb27r3xio!cn9ltuwp?.gak1j0s 5yzqf,4";
    this.KeyArray[0x19] = "mj,409 6.onv?bph1k7r5culseg8azwtyqdfxi32!";
    this.KeyArray[0x1a] = "ahk7cmqn1!x38p0owtfdeiv2? l695j4szg.ybu,r";
    this.KeyArray[0x1b] = "firdkn9q 53y7z21gm0wtjoe?l4a,6.sxhpvub!c8";
    this.KeyArray[0x1c] = "ei!bqfkutcl4m3xwraz1sh0jvp,87n2d9?oy .g56";
    this.KeyArray[0x1d] = ".12a6vqfxmj3y90sbprz4?8dgthcneuk5i,w7 lo!";
    this.KeyArray[30] = "56zc4v mhibyu3r,gn?aq2f.8p90!kdo1jx7sletw";
    this.KeyArray[0x1f] = "oxw3s!1.mpl8iuf2hnyejd76q,rcb5?g90z4akvt ";
    this.KeyArray[0x20] = "i2?,61xqtz8379fs.o50dabvmkejw!chun pr4lgy";
    this.KeyArray[0x21] = "qwertyuiopasdfghjklzxcvbnm,.!? 0123456789";
    this.KeyArray[0x22] = "1f6vap5ht8,9u0zbwcmkexr3.?nl7ig2d y!4qsoj";
    this.KeyArray[0x23] = ".4fw6l5d,qxsg8 anjb9vy1?rupkco30ime2h!t7z";
    this.KeyArray[0x24] = "jo 37xunik4h6f.beg8wlpaz5m1sc9rq?2t,y!vd0";
    this.KeyArray[0x25] = "9kfwpn,a!e7th?cvj2s 6d31yuz.m0qi45b8xrglo";
    this.KeyArray[0x26] = "mv ezpfb1jxtodcas7!8.iw,l34h?y9nur620k5gq";
    this.KeyArray[0x27] = "5hps6!2gnw7zc dmao,kru9?.fqvejib31lytx804";
    this.KeyArray[40] = "krn3f1!bghljicw,e65s987yqpza ovdm4tu.2x0?";
    this.KeyArray[0x29] = "26t5nrsc87u93k!yh0.4xq? zbvajilwpeo,mf1dg";
    this.KeyArray[0x2a] = "h02ixl,? p.ntrz8dbo3ac179jeys5u4f6gwkmvq!";
    this.KeyArray[0x2b] = "bc6a0 gvewx28ynkqfi3dmo.s?14jtp9u5z7rlh!,";
    this.KeyArray[0x2c] = "024rha1k7usyt5bvi3mgxlwdopjnq89,.z6ce !f?";
    this.KeyArray[0x2d] = "ru78besj2qta. ,zvg1p?ol!4y60xkhfnm53ci9dw";
    this.KeyArray[0x2e] = "74cnvislo3uptdzh8xy59kefb!a?0rwjm. q,6g21";
    this.KeyArray[0x2f] = "xnpl8vciz. fd9w541rog!t?e,k2063abyqmhs7ju";
    this.KeyArray[0x30] = "41vup5wzi9!xke.rtbo23?aml8n0gh6qsdj 7yc,f";
    this.KeyArray[0x31] = ",mskq9utjpvh75e0dxn6l8a?!c .yr4iwb31ogz2f";
    this.KeyArray[50] = "4mgikxt,pj.ad?s590fbe731uvqlhrynw !62coz8";
    this.KeyArray[0x33] = "c.h3?8zsrn1gepudxbl6v7!9i,o 0qya24fmkwjt5";
    this.KeyArray[0x34] = "qzkx1d2cei vug.o3a8s4yhr,?ml0!5n9tbpw6jf7";
    this.KeyArray[0x35] = "0g,j42obvx5isr8mk.z!l f9tweqhcd3?671yunpa";
    this.KeyArray[0x36] = "c4lg. xstnpw1ok?f2j0!hqaviy7b8z5d63ur9,em";
    this.KeyArray[0x37] = "k3 u49x5vtoh!1?szery,lpciq6n8.b207wmgjdaf";
    this.KeyArray[0x38] = "px6b3?vo,em.059!k7jqt2g1uhzwlsrfiydacn4 8";
    this.KeyArray[0x39] = "!zcjtx45pin.hu8eroa?,w710y396 bksgqd2lfvm";
    this.KeyArray[0x3a] = ",w3v4fkei!g6y9c?8ajz01rohqbdps5.n7t mxu2l";
    this.KeyArray[0x3b] = "yp5eswxq6dukbi9ljtzo.2?af37,g1vc0rh4 !8mn";
    this.KeyArray[60] = "s!vje2fm0tybx63 wri48,o?upnh.1z5dc97qgkla";
    this.KeyArray[0x3d] = "1gor0pkba.cy3efdmtxui5l?9v24z!w8sj6n hq,7";
    this.KeyArray[0x3e] = "kzmed1?yurqx 2bi.paosghcvjl850fnw943,t67!";
    this.KeyArray[0x3f] = "aje!k9l,uhy15f?sb3ndpcxg.2zvwqom487it60 r";
    this.Decrypted.Text = "Fuck the system, fuck the fa!";
    this.CheckBox1.Checked = false;
    this.h = false;
    this.Button2.Visible = false;
    this.Button1.Visible = false;
    this.Decrypted.Visible = false;
    this.Crypted.Visible = false;
    this.Crypted.Text = MyProject.Computer.Clipboard.GetText();
    this.Width = 0xf5;
    this.Height = 0x66;
}


Password promt:
Code: Select all
private void super_Click(object sender, EventArgs e)
{
    if (Operators.CompareString(this.pasvord.Text, "******", true) == 0)
    {
        this.Text = "Try again...";
        this.h = true;
    }
    else
    {
        if ((Operators.CompareString(this.pasvord.Text, "******", true) == 0) & this.h)
        {
            this.pasvord.Visible = false;
            this.super.Visible = false;
            this.Button2.Visible = true;
            this.Crypted.Visible = true;
            this.Decrypted.Visible = true;
            this.Button1.Visible = true;
            this.D1.Visible = true;
            this.D2.Visible = true;
            this.Button3.Visible = true;
            this.CheckBox1.Visible = true;
            this.h = false;
            this.AcceptButton = this.Button1;
            this.Text = "CryptLine by Zndy 2011";
            this.Width = 0x3e6;
            this.Height = 0x66;
            return;
        }
        this.Text = "Try again...";
        this.h = false;
    }
    this.pasvord.Text = "";
}

Encrypting:
Code: Select all
private void Button1_Click(object sender, EventArgs e)
{
    this.Cursor = Cursors.WaitCursor;
    this.Button2.Visible = false;
    this.Button1.Visible = false;
    this.Button3.Visible = false;
    this.Decrypted.Visible = false;
    this.Crypted.Visible = false;
    this.D1.Visible = false;
    this.D2.Visible = false;
    this.CheckBox1.Visible = false;
    VBMath.Randomize();
    this.sumbsa = 0;
    this.upis = "";
    this.k = (int) Math.Round((double) Conversion.Fix((float) (VBMath.Rnd() * 64f)));
    this.Crypted.Text = "";
    if (Operators.CompareString(this.Decrypted.Text, "", true) == 0)
    {
        this.Decrypted.Text = "ERROR: nothing to encrypt.";
    }
    else if (Strings.Len(this.Decrypted.Text) > 0x1e240)
    {
        this.Crypted.Text = this.Decrypted.Text;
        this.Decrypted.Text = "ERROR: too long.";
    }
    else
    {
        int index = 0;
        do
        {
            this.bs[index] = 0;
            this.ma[index] = 0;
            this.bsa[index] = 0;
            index++;
        }
        while (index <= 40);
        int num2 = 0;
        do
        {
            int num3 = 0;
            do
            {
                this.azbuka[(num2 * 0x29) + num3] = Conversions.ToString(this.KeyArray[this.k][num2]) + Conversions.ToString(this.KeyArray[this.k][num3]);
                num3++;
            }
            while (num3 <= 40);
            num2++;
        }
        while (num2 <= 40);
        int num15 = Strings.Len(this.Decrypted.Text) - 1;
        for (int i = 0; i <= num15; i++)
        {
            if ((i % 0x3e8) == 0)
            {
                this.Text = "Reading: " + Conversions.ToString(Conversion.Fix((double) (((double) ((i + 1) * 100)) / ((double) Strings.Len(this.Decrypted.Text))))) + "%";
            }
            this.cryptzbuki[i] = Conversions.ToString(this.Decrypted.Text[i]);
        }
        if (Strings.Len(this.Decrypted.Text) < 0x3e8)
        {
            int num16 = Strings.Len(this.Decrypted.Text) - 1;
            for (int k = 0; k <= num16; k++)
            {
                int num6 = 0;
                do
                {
                    if (Operators.CompareString(Conversions.ToString(this.KeyArray[this.k][num6]), this.cryptzbuki[k], true) == 0)
                    {
                        this.bs[num6]++;
                        break;
                    }
                    num6++;
                }
                while (num6 <= 40);
            }
        }
        else
        {
            int num7 = 0;
            do
            {
                int num8 = 0;
                do
                {
                    if (Operators.CompareString(Conversions.ToString(this.KeyArray[this.k][num8]), this.cryptzbuki[num7], true) == 0)
                    {
                        this.bs[num8]++;
                        break;
                    }
                    num8++;
                }
                while (num8 <= 40);
                num7++;
            }
            while (num7 <= 0x3e7);
        }
        if (Strings.Len(this.Decrypted.Text) < 0x3e8)
        {
            int num9 = 0;
            do
            {
                this.bsa[num9] = (int) Math.Round((double) (1.0 + Conversion.Fix((double) (((double) (this.bs[num9] * 0x668)) / ((double) Strings.Len(this.Decrypted.Text))))));
                this.sumbsa += this.bsa[num9];
                num9++;
            }
            while (num9 <= 0x27);
        }
        else
        {
            int num10 = 0;
            do
            {
                this.bsa[num10] = (int) Math.Round((double) (1.0 + Conversion.Fix((double) (((double) (this.bs[num10] * 0x668)) / 1000.0))));
                this.sumbsa += this.bsa[num10];
                num10++;
            }
            while (num10 <= 0x27);
        }
        this.bsa[40] = 0x691 - this.sumbsa;
        this.ma[0] = 0;
        int num11 = 1;
        do
        {
            this.ma[num11] = this.ma[num11 - 1] + this.bsa[num11 - 1];
            num11++;
        }
        while (num11 <= 40);
        if (this.k < 0x29)
        {
            this.upis = Conversions.ToString(this.KeyArray[this.mesec][(int) Math.Round((double) Conversion.Fix((float) (VBMath.Rnd() * 27f)))]) + Conversions.ToString(this.KeyArray[this.mesec][this.k]);
        }
        else
        {
            this.upis = Conversions.ToString(this.KeyArray[this.mesec][(int) Math.Round((double) (27f + Conversion.Fix((float) (VBMath.Rnd() * 14f))))]) + Conversions.ToString(this.KeyArray[this.mesec][this.k - 0x29]);
        }
        int num12 = 0;
        do
        {
            this.upis = this.upis + this.azbuka[this.ma[num12]];
            num12++;
        }
        while (num12 <= 40);
        int num17 = Strings.Len(this.Decrypted.Text) - 1;
        for (int j = 0; j <= num17; j++)
        {
            if ((j % 0x3e8) == 0)
            {
                this.Text = "Encrypting: " + Conversions.ToString(Conversion.Fix((double) (((double) ((j + 1) * 100)) / ((double) Strings.Len(this.Decrypted.Text))))) + "%";
            }
            int num14 = 0;
            do
            {
                if (Operators.CompareString(this.cryptzbuki[j], Conversions.ToString(this.KeyArray[this.k][num14]), true) == 0)
                {
                    this.upis = this.upis + this.azbuka[(int) Math.Round((double) (Conversion.Fix((float) (this.bsa[num14] * VBMath.Rnd())) + this.ma[num14]))];
                    break;
                }
                num14++;
            }
            while (num14 <= 40);
        }
        this.Crypted.Text = this.upis;
        if (this.CheckBox1.Checked)
        {
            this.Decrypted.Text = this.upis;
        }
        MyProject.Computer.Clipboard.SetText(this.Crypted.Text);
    }
    this.Text = "CryptLine by Zndy 2011";
    this.Button2.Visible = true;
    this.Crypted.Visible = true;
    this.Decrypted.Visible = true;
    this.Button1.Visible = true;
    this.D1.Visible = true;
    this.Button3.Visible = true;
    this.D2.Visible = true;
    this.CheckBox1.Visible = true;
    this.AcceptButton = this.Button1;
    this.Cursor = Cursors.Default;
}

Decrypting:
Code: Select all
private void Button2_Click(object sender, EventArgs e)
{
    int num7;
    this.upis = "";
    this.Button3.Visible = false;
    this.Cursor = Cursors.WaitCursor;
    this.Button2.Visible = false;
    this.Button1.Visible = false;
    this.Decrypted.Visible = false;
    this.Crypted.Visible = false;
    this.D1.Visible = false;
    this.D2.Visible = false;
    this.CheckBox1.Visible = false;
    int index = 0;
    do
    {
        this.ma[index] = 0;
        index++;
    }
    while (index <= 0x29);
    if (Strings.Len(this.Crypted.Text) <= 0x54)
    {
        this.Decrypted.Text = "ERROR: bad code.";
        goto Label_04A5;
    }
    int num15 = Strings.Len(this.Crypted.Text) - 1;
    for (int i = 0; i <= num15; i++)
    {
        if ((i % 0x3e8) == 0)
        {
            this.Text = "Reading: " + Conversions.ToString(Conversion.Fix((double) (((double) ((i + 1) * 100)) / ((double) Strings.Len(this.Crypted.Text))))) + "%";
        }
        this.crich[i] = this.Crypted.Text[i];
    }
    int num3 = 0;
    do
    {
        if (this.crich[0] == this.KeyArray[this.mesec][num3])
        {
            int num4 = 0;
            do
            {
                if (this.crich[1] == this.KeyArray[this.mesec][num4])
                {
                    this.k = num4;
                    goto Label_01F0;
                }
                num4++;
            }
            while (num4 <= 40);
        }
        num3++;
    }
    while (num3 <= 0x1a);
    int num5 = 0x1b;
    do
    {
        if (this.crich[0] == this.KeyArray[this.mesec][num5])
        {
            int num6 = 0;
            do
            {
                if (this.crich[1] == this.KeyArray[this.mesec][num6])
                {
                    this.k = num6 + 0x29;
                    break;
                }
                num6++;
            }
            while (num6 <= 40);
        }
        num5++;
    }
    while (num5 <= 40);
Label_01F0:
    num7 = 0;
    do
    {
        int num8 = 0;
        do
        {
            this.azbuka[(num7 * 0x29) + num8] = Conversions.ToString(this.KeyArray[this.k][num7]) + Conversions.ToString(this.KeyArray[this.k][num8]);
            num8++;
        }
        while (num8 <= 40);
        num7++;
    }
    while (num7 <= 40);
    int num9 = 0;
    do
    {
        this.cryptzbuki[num9] = Conversions.ToString(this.crich[(2 * num9) + 2]) + Conversions.ToString(this.crich[(2 * num9) + 3]);
        num9++;
    }
    while (num9 <= 40);
    int num10 = 0;
    do
    {
        int num11 = 0;
        do
        {
            if (Operators.CompareString(this.cryptzbuki[num10], this.azbuka[num11], true) == 0)
            {
                this.ma[num10] = num11;
                break;
            }
            num11++;
        }
        while (num11 <= 0x690);
        num10++;
    }
    while (num10 <= 40);
    this.ma[0x29] = 0x691;
    double num16 = Conversion.Int((double) (((double) (Strings.Len(this.Crypted.Text) - 2)) / 2.0));
    for (double j = 42.0; j <= num16; j++)
    {
        if ((j % 1000.0) == 0.0)
        {
            this.Text = "Decrypting: " + Conversions.ToString(Conversion.Fix((double) (((j - 84.0) / (((double) (Strings.Len(this.Crypted.Text) - 0x56)) / 2.0)) * 100.0))) + "%";
        }
        this.cryptzbuki[(int) Math.Round(j)] = Conversions.ToString(this.crich[(int) Math.Round((double) (2.0 * j))]) + Conversions.ToString(this.crich[(int) Math.Round((double) ((2.0 * j) + 1.0))]);
        int num13 = 0;
        do
        {
            int num17 = this.ma[num13 + 1] - 1;
            for (int k = this.ma[num13]; k <= num17; k++)
            {
                if (Operators.CompareString(this.cryptzbuki[(int) Math.Round(j)], this.azbuka[k], true) == 0)
                {
                    this.upis = this.upis + Conversions.ToString(this.KeyArray[this.k][num13]);
                    break;
                }
            }
            num13++;
        }
        while (num13 <= 40);
    }
    this.Decrypted.Text = this.upis;
    this.Crypted.Text = this.upis;
Label_04A5:
    this.Button2.Visible = true;
    this.Crypted.Visible = true;
    this.Decrypted.Visible = true;
    this.Button1.Visible = true;
    this.Button3.Visible = true;
    this.D1.Visible = true;
    this.D2.Visible = true;
    this.CheckBox1.Visible = true;
    this.AcceptButton = this.Button2;
    this.Text = "CryptLine by Zndy 2011";
    this.Cursor = Cursors.Default;
}

Other buttons:
Code: Select all
private void Button3_Click(object sender, EventArgs e)
{
    this.Crypted.Text = MyProject.Computer.Clipboard.GetText();
}
private void D1_Click(object sender, EventArgs e)
{
    this.Decrypted.Text = "";
}
private void D2_Click(object sender, EventArgs e)
{
    this.Crypted.Text = "";
}
learnzndy
New User
New User
 
Posts: 9
Joined: Tue Jan 31, 2012 4:21 am
Blog: View Blog (0)


Previous

Return to Crypto

Who is online

Users browsing this forum: No registered users and 0 guests