Помогите решить проблему с пакетом. При одном и том же логине на стороне клиента, на стороне сервера он расшифровывается в "случайный" набор символов. Если включить автосоздание аккаунтов, то сервер создает аккаунт и присылает "LoginOK".
Логично предположить, что проблема на этапе сборки и/или шифрования, не где - я хз уже всё облазил, но не догоняю.
Очень прошу помочь советом, ошибка где-то в этом коде (шифрование нагло стырено из L2NET):
	Код:
	//Осторожно быдлокод! Уберите женщин и беременных детей от мониторов!!
		// RSA_pubKeyMod must point to 128-bytes length buffer
		public bool create( byte[] szL2Login, byte[] szL2Password, uint ggAuthResponse, byte[] RSA_pubKeyMod )
		{
			//
			// vars
			int l2l_len = szL2Login.Length;
			int l2p_len = szL2Password.Length;
            byte[] l2login = new byte[L2_LOGIN_MAXLEN];
            byte[] l2password = new byte[L2_PASSWORD_MAXLEN];
			byte[] block128 = new byte[128];
			int           i = 0;
			const int     l2l_offset = 94;
			const int     l2p_offset = 108;
			// check strings length
			if( (l2l_len<1) || (l2l_len>L2_LOGIN_MAXLEN) )
			{
				Console.WriteLine( "L2Login_RequestAuthLogin::create(): L2 Login length must be [1..{0}] chars\n", L2_LOGIN_MAXLEN );
				return false;
			}
			if( (l2p_len<1) || (l2p_len>L2_PASSWORD_MAXLEN) )
			{
				Console.WriteLine( "L2Login_RequestAuthLogin::create(): L2 Password length must be [1..{0}] chars\n", L2_PASSWORD_MAXLEN );
				return false;
			}
			// copy strings
			for( i=0; i<(int)l2l_len; i++ ) l2login[i]    = szL2Login[i];
			for( i=0; i<(int)l2p_len; i++ ) l2password[i] = szL2Password[i];
            //
            
            Array.Copy(l2login , 0, block128, l2l_offset, L2_LOGIN_MAXLEN);
            Array.Copy(l2password, 0, block128, l2p_offset, L2_PASSWORD_MAXLEN);
			// RSA encode block...
			if( !this.block_encode_RSA( ref block128, (uint)block128.Length, RSA_pubKeyMod ) ) return false;
			// construct packet
			this.writeReset();
			this.setPacketType( 0x00 );                    // RequestAuthLogin code
			this.writeBytes( block128, (uint)block128.Length ); // block with login/password
			this.writeUInt( ggAuthResponse );              // from GGAuthResponse
			for( i=0; i<16; i++ ) this.writeUChar( 0x00 ); // 16 NULLs
			this.writeUChar( 0x08 );
			for( i=0; i<10; i++ ) this.writeUChar( 0x00 ); // some 11 bytes
			// now packet must be padded to 8-byte border
			// next caller must add checksum, and so on...
			return true;
		}
		// for internal use only
		// encode block with login/password
		// RSA_pubKeyMod must point to 128-bytes length buffer
		protected bool block_encode_RSA( ref byte[] block , uint blockSize, byte[] RSA_pubKeyMod )
		{
			//
			byte[] Exponent = {1,0,1};
			//Create a new instance of RSAParameters.
			System.Security.Cryptography.RSAParameters RSAKeyInfo = new System.Security.Cryptography.RSAParameters();
			//Set RSAKeyInfo to the public key values. 
			RSAKeyInfo.Modulus = RSA_pubKeyMod;
			RSAKeyInfo.Exponent = Exponent;
			L2_Login.RSAManaged poo = new L2_Login.RSAManaged();
			poo.ImportParameters(RSAKeyInfo);
			byte[] outb = new byte[128];
			outb = poo.EncryptValue(block);
			return true;
		}
 По сути меняться могут только RSA_pubKeyMod, так как ggAuthResponse у меня всегда равен нулю.
Добавлено через 13 часов 20 минут
Зашибись у меня RSA работает 

 Два дня не спал прост, как проспался, так сразу заметил.