You are viewing our Forum Archives. To view or take place in current topics click here.
[C#] Simple CPU Auth
Posted:

[C#] Simple CPU AuthPosted:

SK7
  • Powerhouse
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
Hey guys,

I got bored and was testing other things and since I came across my own way and more safer way I decided to post my original code I written.

So all we need, is a textbox and a button and your site/local server or whatever.

What you need to do:
Create a text document and in this document we place our CPU Key's in. And then the app reads the file and checks if the input of textbox matches.

You will need to be using:

using System.Net;
using System.Net.NetworkInformation;
using System.Web;


Then for the button (Which will log you in) you want to create the string for the CPU Key and check for an available network (Checking internet). Like this:

            bool Connection = NetworkInterface.GetIsNetworkAvailable();
            string cpuKey = string.Empty;
            WebClient webClient = new WebClient();
            string strings = null;


Now, we are still on the button. We want to download our .txt file with the CPU key of a user inside it. To do this we use the WebClient (System.Web) usage.
So we use the Connection bool to do this. So:

if (Connection == true)
            {
                strings = webClient.DownloadString("http://example.com/cpukeys.txt");
                webClient.Dispose();
            }

This checks if you can connect to internet and if you can it downloads the txt file.
But we should always create and else statement to notify the user that they can't connect to internet. So this is simple, we use the else {} with a popup (MessageBox).
If you don't know how then here:

else
{
   MessageBox.Show("No internet connection!");
}

Now we want to read the txt file and check if the CPU key the user enters in the textbox exists. So we simply use our string "strings" to see if the cpuKey entered in textbox is contained in the txt file and if it is, we say CPU Authed! or something.

if (strings.Contains(cpuKey = textBox1.Text))
            {
                MessageBox.Show("CPU Authed", "", MessageBoxButtons.OK,  MessageBoxIcon.Information);
           
            }

And yet again we need to notify the user if the CPU Key isn't there. So we simply do:

else
            {
                MessageBox.Show("Not authed", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }


This is great but not secure and can easily be cracked. That's why I used another method checking a database (But my app is confused so it should be safe).

Credit: Me (For coding this)
AWL: For being awesome and testing.

Have fun ^_^


Last edited by SK7 ; edited 2 times in total

The following 2 users thanked SK7 for this useful post:

akaDollar (09-30-2013), Stedos (09-30-2013)
#2. Posted:
Bao
  • TTG Senior
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 1,721
Reputation Power: 74
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 1,721
Reputation Power: 74
Sweet job Carbon...Im sure this will help tons!
#3. Posted:
SK7
  • Powerhouse
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
It's so simple and fun for kids to use. I guess they will say they created it for their tool without credits. But I don't care. It's so simple to do.
#4. Posted:
Bao
  • TTG Senior
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 1,721
Reputation Power: 74
Status: Offline
Joined: Aug 23, 201014Year Member
Posts: 1,721
Reputation Power: 74
Carb0n wrote It's so simple and fun for kids to use. I guess they will say they created it for their tool without credits. But I don't care. It's so simple to do.

I realize but its the thought that matters..Hopefully they will include you for credit.
#5. Posted:
SK7
  • Powerhouse
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
GHM_I_FaLcOn wrote What is it im New in Coding C++ and C#


A tool that basically checks internet connection, downloads the txt from your website and then reads that file and checks if the CPU you entered in the textBox matches anything inside that text. If it does, it shows a message box saying "Your authed" and if not then it will say "Not authed".
#6. Posted:
ip
  • V5 Launch
Status: Offline
Joined: Dec 30, 201211Year Member
Posts: 3,778
Reputation Power: 3016
Status: Offline
Joined: Dec 30, 201211Year Member
Posts: 3,778
Reputation Power: 3016
Really. Why did you release it?
We should have kept it. But hey, it's great that the community loves it and I am sure it will help tons.
#7. Posted:
SK7
  • Powerhouse
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
GHM_I_FaLcOn wrote
Carb0n wrote
GHM_I_FaLcOn wrote What is it im New in Coding C++ and C#


A tool that basically checks internet connection, downloads the txt from your website and then reads that file and checks if the CPU you entered in the textBox matches anything inside that text. If it does, it shows a message box saying "Your authed" and if not then it will say "Not authed".


Can You Help Me and CPI auth LoL on What ?

Add me on skype: CrimsonSN7
#8. Posted:
ZZ9_x_iHaXoRZz
  • Rated Awesome
Status: Offline
Joined: Mar 11, 201113Year Member
Posts: 4,436
Reputation Power: 8964
Status: Offline
Joined: Mar 11, 201113Year Member
Posts: 4,436
Reputation Power: 8964
Damnnnn, i was about to add this to my paid version of the tool and thought it was going to be different. time to think of a new way lol
#9. Posted:
Stedos
  • TTG Senior
Status: Offline
Joined: Apr 14, 201113Year Member
Posts: 1,665
Reputation Power: 131
Status: Offline
Joined: Apr 14, 201113Year Member
Posts: 1,665
Reputation Power: 131
Awesome release! Will help people learning, and people who want to make servers in the future!
#10. Posted:
SK7
  • Powerhouse
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
Status: Offline
Joined: May 26, 201311Year Member
Posts: 491
Reputation Power: 22
ZZ9_x_iHaXoRZz wrote Damnnnn, i was about to add this to my paid version of the tool and thought it was going to be different. time to think of a new way lol


Use a method which will not download anything to the app and instead connect and disconnect from a database and also confuse your program.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.