C# LGAuth [Private]
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));
}
}[/2][/1][/0]You need to use my HTTPWrappers, provided here, for this to function properly.
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.