/// <summary> /// Runs an RC4 encryption with a specified key /// </summary> /// <param name="xKey"></param> /// <param name="xConfounder"></param> /// <param name="xPayload"></param> /// <returns></returns> public static byte[] RunKerberosEncrypt(byte[] xKey, ref byte[] xConfounder, ref byte[] xPayload) { RC4 xrc4 = new RC4(xKey); return(xrc4.KerberosEncrypt(ref xConfounder, ref xPayload)); }
/// <summary> /// Runs an RC4 on the specified data using the specified key /// </summary> /// <param name="xKey"></param> /// <param name="xData"></param> /// <returns></returns> public static byte[] RunAlgorithm(byte[] xKey, byte[] xData) { RC4 xrc4 = new RC4(xKey); return(xrc4.RunAlgorithm(xData)); }
/// <summary> /// Runs a Kerberos RC4 encryption on the specified data /// </summary> /// <param name="xKey">Key input</param> /// <param name="xConfounder">outputs the confounder</param> /// <param name="xPayload">Outputs the payload</param> /// <param name="xConLen">Confounder Length</param> /// <param name="xData">Outputs the decrypted data</param> /// <returns></returns> public static bool RunKerberosDecrypt(byte[] xKey, byte[] xData, out byte[] xConfounder, int xConLen, out byte[] xPayload) { RC4 xrc4 = new RC4(xKey); return(xrc4.KerberosDecrypt(xData, out xConfounder, xConLen, out xPayload)); }
bool xDecrypt(out DJsIO PayLoad) { PayLoad = null; try { IO.Position = 0; byte[] xHeaderKey = IO.ReadBytes(0x10); xRC4 = new RC4(xComputeRC4Key(xHeaderKey)); byte[] xData = IO.ReadBytes(0x184); byte[] xPayload; byte[] xConfounder; if (!xRC4.KerberosDecrypt(xData, out xConfounder, 8, out xPayload)) return false; bool xsuccess = xComputeHeaderKey(xConfounder, xPayload).HexString() == xHeaderKey.HexString(); if (xsuccess) PayLoad = new DJsIO(xPayload, true); return xsuccess; } catch { return false; } }