public static FTEncipher AllocLuaScriptFileEncipher() { byte[] rgbKey; byte[] rgbIV; FTEncipher ret = new FTEncipher(); ret.CreatePublicKeyRSAEncryptProvider(UniGameResources.uniGameResourcesSupport.LuaRsaPublicKey); UniGameResources.uniGameResourcesSupport.ResolveLuaDesKey(out rgbKey, out rgbIV); ret.CreateDecryptProvider(rgbKey, rgbIV); return(ret); }
private static FTEncipher getDecryptHandler() { if (DecryptHandler != null) { return(DecryptHandler); } DecryptHandler = new FTEncipher(); DecryptHandler.CreatePublicKeyRSAEncryptProvider(publickey); byte[] desKeyByte = Encoding.ASCII.GetBytes(deskey); byte[] rgbKey = new byte[8]; byte[] rgbIV = new byte[8]; for (int j = 0; j < 8; j++) { rgbKey[j] = desKeyByte[j]; rgbIV[j] = desKeyByte[j + 8]; } DecryptHandler.CreateDecryptProvider(rgbKey, rgbIV); return(DecryptHandler); }