Пример #1
0
        public static Encryption CreateClientLogin(LoginEncryptionType type, uint seed, uint key1, uint key2)
        {
            IEncryptor encryptor;
            IDecryptor decryptor;

            switch (type)
            {
            case LoginEncryptionType.None:
                NoEncryption encryption = new NoEncryption();
                encryptor = encryption;
                decryptor = encryption;
                break;

            case LoginEncryptionType.Old:
            case LoginEncryptionType.Rare:
                throw new Exception("Unsupported login encryption.");

            case LoginEncryptionType.New:
                encryptor = new LoginEncryption(seed, key1, key2);
                decryptor = new NoEncryption();
                break;

            default:
                throw new Exception("Internal error.");
            }

            return(new Encryption(encryptor, decryptor));
        }
Пример #2
0
        public static Encryption CreateClientLogin(LoginEncryptionType type, uint seed, uint key1, uint key2)
        {
            IEncryptor encryptor;
            IDecryptor decryptor;

            switch (type)
            {
                case LoginEncryptionType.None:
                    NoEncryption encryption = new NoEncryption();
                    encryptor = encryption;
                    decryptor = encryption;
                    break;

                case LoginEncryptionType.Old:
                case LoginEncryptionType.Rare:
                    throw new Exception("Unsupported login encryption.");

                case LoginEncryptionType.New:
                    encryptor = new LoginEncryption(seed, key1, key2);
                    decryptor = new NoEncryption();
                    break;

                default:
                    throw new Exception("Internal error.");
            }

            return new Encryption(encryptor, decryptor);
        }