public AuthServer() { status = 0; rsa = new MxoRSA(); tf = new MxoTwofish(); md5 = new Md5(); wl = new WorldList(); blankIV = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; }
private int rsaDecryptCheck() { MxoRSA rsa = new MxoRSA(); // 128 bytes as blob, preExistent byte[] blob={0x53,0x18,0x02,0x10,0x4f,0x69,0xba,0x41,0x57,0x80,0x27,0xa3,0x87,0x88,0xb4,0x5f,0xc8,0xd0,0xad,0x39,0x9e,0x7d,0x92,0x57,0x4e,0x94,0x48,0x95,0x3c,0x66,0x34,0x26,0x34,0xb5,0x94,0xa4,0xa1,0xd0,0x0b,0xac,0xb1,0x0b,0xc3,0x23,0xb1,0x98,0xa2,0xc8,0x21,0xd8,0x5f,0x83,0xda,0x00,0x63,0x6f,0x99,0xeb,0x2b,0x34,0x77,0x2a,0x44,0x57,0x13,0xd9,0x0e,0x00,0x4c,0x71,0x07,0x6a,0x9b,0xb3,0xac,0x0c,0x7f,0x9b,0xfe,0x28,0xe4,0x8e,0x7e,0xa6,0xac,0x67,0x7f,0xb6,0xc2,0xba,0xeb,0x95,0x70,0x16,0x09,0x23,0x63,0xc5,0x1e,0x8d,0xea,0xed,0x90,0x8e,0xc7,0xfc,0x3e,0xdb,0x14,0xc0,0xa6,0xab,0x8a,0xc3,0x45,0xbd,0x98,0x07,0x7a,0x15,0x7e,0xc5,0x64,0x45,0xea,0xaa,0x19,0xf6}; byte[] knownResult={0x00,0x04,0x00,0x00,0x00,0x1b,0x00,0x44,0x2c,0x3c,0x13,0x3e,0xb0,0xbf,0x66,0x81,0x5c,0x2b,0x5f,0x43,0x11,0x38,0xe1,0x27,0xe0,0x0e,0x4c,0x08,0x00,0x6c,0x6f,0x6c,0x75,0x73,0x65,0x72,0x00}; byte[] result = rsa.decryptWithPrivkey(blob); if (!ArrayUtils.equal(knownResult, result)) { Console.Write("Failed\n"); return 0; } Output.Write("OK\n"); return 1; }