You need to use my HTTPWrappers, provided here, for this to function properly.Code:using System; using System.Drawing; using System.Net; using System.IO; using System.Windows.Forms; static class LGAuth { public static Boolean Auth(String Username, String Password, String Key) { HTTPWrapper Wrapper = new HTTPWrapper(); String Gpc = Key.Substring(0, (int)Math.Round((Decimal)Key.Length / 2)) + (new Random((Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds).Next()); Bitmap AuthImage = (Bitmap)Image.FromStream((Stream)Wrapper.get_stream("http://logicalgamers.com/auth/auth.php?user=" + Username + "&pass=" + Password + "&key=" + Key + "&gpc=" + Gpc)); String Crypt = ""; for (int y = 0; y < AuthImage.Width; y++) { for (int x = 0; x < AuthImage.Width; x++) { Crypt += ((Char)AuthImage.GetPixel(x, y).R).ToString(); } } int SkipStart = Int32.Parse(Crypt.Substring(0, Crypt.IndexOf("/"))); Crypt = Crypt.Substring((Crypt.IndexOf("/") + 1), Crypt.Length - (Crypt.IndexOf("/") + 1)); String Decrypt = Decode(Crypt.Substring(0, SkipStart) + Crypt.Substring((SkipStart + 10), Crypt.IndexOf("&") - (SkipStart + 10))); String[] rawInfo = Decrypt.Split('/'); String rawGpc = Crypt.Substring((Crypt.IndexOf("&") + 1), 16); if (rawInfo[0] == Username && rawInfo[1] == Key && rawInfo[2] == Password && Gpc.IndexOf(rawGpc) > -1) { return true; } return false; } private static String Decode(String Crypt) { return System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(Crypt)); } }
This method does NOT save the image on the user's computer, and rather parses it with a memory stream.
This method also fully decrypts Arti's encryption, meaning it will obtain the data properly and without unsafe operations.
Results 1 to 8 of 8
Thread: C# LGAuth [Private]
- 18 Jul. 2010 10:20am #1
- Age
- 30
- Join Date
- Nov. 2009
- Location
- Anaheim, California
- Posts
- 1,065
- Reputation
- 99
- LCash
- 0.00
C# LGAuth [Private]
- 18 Jul. 2010 01:09pm #2
Thanks chris, I'll be using this on my next big project.
Shh, I'm watching My little pony.
- 19 Jul. 2010 01:07am #3
- Age
- 30
- Join Date
- Nov. 2009
- Location
- Anaheim, California
- Posts
- 1,065
- Reputation
- 99
- LCash
- 0.00
- 29 Jul. 2010 09:59am #4
- Age
- 30
- Join Date
- Nov. 2009
- Location
- Anaheim, California
- Posts
- 1,065
- Reputation
- 99
- LCash
- 0.00
The auth was once again improved, I removed a small bit of data that was not needed. Also I fixed the image reading method because as Artificial stated to me, "If the user has a long username or password, it can loop down to the next row/y axis." So it not reads all of the pixels for text and properly checks the data.
- 31 Jul. 2010 11:55pm #5
- 03 Aug. 2010 02:15am #6
- Age
- 30
- Join Date
- Nov. 2009
- Location
- Anaheim, California
- Posts
- 1,065
- Reputation
- 99
- LCash
- 0.00
- 03 Aug. 2010 02:49am #7
- 03 Aug. 2010 06:14am #8