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

		int len = dis.readInt();
		byte[] encName = new byte[len];
		dis.read(encName);

		len = dis.readInt();
		byte[] retCookie = new byte[len];
		dis.read(retCookie);

		int challengeC1 = dis.readInt();

		len = dis.readInt();
		byte[] encCliPubByt = new byte[len];
		dis.read(encCliPubByt);

		byte[] cookie = serverCryptoHelper.buildCookie(
				rcvPkt.getAddress(), rcvPkt.getPort(),
				secret);
		
		if (!validateCookie(cookie,retCookie)){
			System.out.println("Cookies doesn't match !!");
			dPktBuffer[0] = 91;
			DatagramPacket dPkt = new DatagramPacket(dPktBuffer,
					dPktBuffer.length, rcvPkt.getAddress(),
					rcvPkt.getPort());
			dSock.send(dPkt);
			return;
		}

		byte[] decUserName = serverCryptoHelper.decUsingPrivKey(
				encName, SER_PRIVATE_KEY_NAME);

		byte[] pwdHashBytes = getHashFromFile(decUserName);

		byte[] decCliPubKeyByt = serverCryptoHelper
				.decUsingPwdHash(encCliPubByt, pwdHashBytes);
		SecretKey secKey = serverCryptoHelper.genSecretKey(
				dhPrivateKey, decCliPubKeyByt);

		secretKeyMap.put(new String(decUserName), secKey);

		byte[] dhPubKeyBytes = dhPublicKey.getEncoded();
		byte[] encDHPubKeyByt = serverCryptoHelper
				.encUsingPwdHash(dhPubKeyBytes, pwdHashBytes);

		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		DataOutputStream dos = new DataOutputStream(baos);

		String pbePrivFileName = new String(decUserName)
				+ "PBEPrivKey";
		byte[] ybytes = serverCryptoHelper.readFromFile(pbePrivFileName);

		dos.writeInt(ybytes.length);
		dos.write(ybytes);

		dos.writeInt(challengeC1 - 1);
		dos.flush();
		byte[] data = baos.toByteArray();
		Cipher cipher = Cipher.getInstance("DES");
		cipher.init(Cipher.ENCRYPT_MODE, secKey);
		byte[] encryptedYC1Bytes = cipher.doFinal(data);

		int challengeC2 = serverCryptoHelper.generateNonce();
		challengeMap.put(new String(decUserName), challengeC2);

		baos = new ByteArrayOutputStream();
		dos = new DataOutputStream(baos);
		dos.writeInt(encDHPubKeyByt.length);
		dos.write(encDHPubKeyByt);
		dos.writeInt(encryptedYC1Bytes.length);
		dos.write(encryptedYC1Bytes);
		dos.writeInt(challengeC2);
		dos.flush();
		byte[] msg3Bytes = baos.toByteArray();

		dPktBuffer[0] = 105;
		buildPktBuffer(msg3Bytes);

		DatagramPacket dPktMsg3 = new DatagramPacket(dPktBuffer,
				dPktBuffer.length, rcvPkt.getAddress(),
				rcvPkt.getPort());
		dSock.send(dPktMsg3);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		} catch (NoSuchPaddingException e) {
			e.printStackTrace();
		} catch (InvalidKeyException e) {
			e.printStackTrace();
		} catch (IllegalBlockSizeException e) {
			e.printStackTrace();
		} catch (BadPaddingException e) {
			e.printStackTrace();
		}
	}