예제 #1
0
 public void Init()
 {
     TmpKey1    = Utils.ShiftKey(ServerKey1, 67);
     TmpKey2    = Utils.XorKey(TmpKey1, ClientKey1);
     TmpKey1    = Utils.ShiftKey(ClientKey2, 29, false);
     DecryptKey = Utils.XorKey(TmpKey1, TmpKey2);
     Decryptor  = new Cryptor(DecryptKey);
     TmpKey1    = Utils.ShiftKey(ServerKey2, 41);
     Decryptor.ApplyCryptor(TmpKey1, 128);
     EncryptKey = new byte[128];
     Buffer.BlockCopy(TmpKey1, 0, EncryptKey, 0, 128);
     Encryptor = new Cryptor(EncryptKey);
 }
예제 #2
0
        public void Init(string region)
        {
            //if (region == "KR" || region == "JP" || region == "RU" || region == "EU" || region == "NA")
            //{
            TmpKey1 = Utils.ShiftKey(ServerKey1, 67);
            //}
            //else
            //{
            //    TmpKey1 = Utils.ShiftKey(ServerKey1, 31);
            //}

            TmpKey2 = Utils.XorKey(TmpKey1, ClientKey1);

            //if (region == "KR" || region == "JP" || region == "RU" || region == "EU" || region == "NA")
            //{
            TmpKey1 = Utils.ShiftKey(ClientKey2, 29, false);
            //}
            //else
            //{
            //    TmpKey1 = Utils.ShiftKey(ClientKey2, 17, false);
            //}

            DecryptKey = Utils.XorKey(TmpKey1, TmpKey2);

            Decryptor = new Cryptor(DecryptKey);

            //if(region == "KR" || region == "JP" || region == "RU" || region == "EU" || region == "NA")
            //{
            TmpKey1 = Utils.ShiftKey(ServerKey2, 41);
            //}
            //else
            //{
            //    TmpKey1 = Utils.ShiftKey(ServerKey2, 79);
            //}

            Decryptor.ApplyCryptor(TmpKey1, 128);
            EncryptKey = new byte[128];
            Buffer.BlockCopy(TmpKey1, 0, EncryptKey, 0, 128);

            Encryptor = new Cryptor(EncryptKey);
        }