private void processLogin4Msg(byte[] pktBuffer, DatagramPacket rcvPkt,
			String clientIP) {
		try {
			DataInputStream dis = new DataInputStream(new ByteArrayInputStream(
					pktBuffer));
			dis.readByte();

			int length = dis.readInt();
			byte[] encUserNamebyte = new byte[length];
			dis.read(encUserNamebyte);
			length = dis.readInt();
			byte[] hashValue = new byte[length];
			dis.read(hashValue);
			length = dis.readInt();
			byte[] signData = new byte[length];
			dis.read(signData);

			byte[] decUserNameByte = serverCryptoHelper.decUsingPrivKey(
					encUserNamebyte, SER_PRIVATE_KEY_NAME);
			KeyFactory kf = KeyFactory.getInstance("RSA");
			EncodedKeySpec x509keySpec = new X509EncodedKeySpec(
					serverCryptoHelper.readFromFile(new String(decUserNameByte)
					+ "PublicKey"));
			PublicKey clientPubKey = kf.generatePublic(x509keySpec);

			Signature sign = Signature.getInstance("SHA1withRSA");
			sign.initVerify(clientPubKey);
			sign.update(hashValue);
			if (!sign.verify(signData)) {
				dPktBuffer[0] = 112;
				DatagramPacket sndPacket = new DatagramPacket(dPktBuffer,
						dPktBuffer.length, rcvPkt.getAddress(),
						rcvPkt.getPort());
				dSock.send(sndPacket);
				return;
			}

			int challengeC2 = challengeMap.get(new String(decUserNameByte));
			SecretKey secretKey = secretKeyMap.get(new String(decUserNameByte));

			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			DataOutputStream dos = new DataOutputStream(baos);
			dos.write(secretKey.getEncoded());
			dos.write(challengeC2 - 1);
			dos.flush();
			String addr = rcvPkt.getAddress() + "/" + rcvPkt.getPort();

			String newClient = new String(decUserNameByte);
			if (loginClientList.get(newClient) != null) {
				dPktBuffer[0] = 113;
			} else {
				dPktBuffer[0] = 107;
				loginClientList.put(newClient, addr);
				System.out.println("Client " + newClient + " joined from "
						+ clientIP);
			}

			DatagramPacket logSuccPkt = new DatagramPacket(dPktBuffer,
					dPktBuffer.length, rcvPkt.getAddress(),
					rcvPkt.getPort());
			dSock.send(logSuccPkt);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		} catch (InvalidKeySpecException e) {
			e.printStackTrace();
		} catch (InvalidKeyException e) {
			e.printStackTrace();
		} catch (SignatureException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}

	}