public StealthNetPacket recvPacket() throws IOException {
		StealthNetPacket pckt = null;
		String str = dataIn.readLine();
		String decrypted = encrypter.decrypt(str, random);
		decrypted = decrypted.split(HEADSEP)[1]; //Strip random header that may be corrupted

		String[] sarr = decrypted.split(STRSEP);
		String message = sarr[0];
		long messageDate = new BigInteger(sarr[1], 16).longValue();
		String messageNonce = sarr[2];
		String messageNonceB64 = sarr[3];
		String MAC = sarr[4];
		System.out.println("rcv str: " + decrypted);
		
		try {
			// Checks the MAC against the message
			Mac mac = Mac.getInstance("HmacMD5");
			mac.init(sKey);
			byte[] utf8 = message.getBytes("UTF8");
			byte[] digest = mac.doFinal(utf8);
			String digestB64 = javax.xml.bind.DatatypeConverter
					.printBase64Binary(digest);
			if (digestB64.equals(MAC)) {
			} else {
				System.err.println("Incoming message altered (invalid hash), communication line unsafe.");
				System.err.println("hash " + digestB64 + " expected " + MAC);
				System.exit(1);
			}
	        long noncein = new BigInteger(messageNonce, 16).longValue();
			if (othernonce+1 == noncein) {
	        	othernonce++;
	        } else if (othernonce == 0) {
	        	nonceSet = true;
	        	othernonce = new BigInteger(messageNonce, 16).longValue();
	        	System.out.println("setting othernonce to " + Long.toHexString(othernonce));
		        //nonce16 = String.format("%x", new BigInteger(1, nonce));
	        	//System.out.println("New nonce 16 " + nonce16);
	        } else {
				System.err.println("Incoming message altered (invalid nonce), communication line unsafe.");
				System.err.println("incoming " + messageNonce + ".");
				System.err.println("other +1 " + Long.toHexString(othernonce+1) +". current " + Long.toHexString(othernonce));
				//System.exit(1);
	        }
			MessageDigest md = MessageDigest.getInstance("SHA-1");
	        md.update((byte) (othernonce)); //Not +1, we just set it to the current.
	        byte[] nonceDigest = md.digest();
			String nonceB64 = javax.xml.bind.DatatypeConverter
					.printBase64Binary(nonceDigest);
			if (messageNonceB64.equals(nonceB64)) {
			} else {
				System.err.println("Incoming message altered (invalid nonce hash), communication line unsafe.");
				System.err.println("incoming " + messageNonceB64 + ".");
				System.err.println("expected " + nonceB64 +". othernonce " + Long.toHexString(othernonce));
				//System.exit(1);
			}
			if (lastdate == 0 || lastdate <= messageDate) { //Hack, needs nano
				lastdate = messageDate;
			} else {
				System.err.println("Timestamp invalid: message from " + messageDate + " before " + lastdate);
			}
		} catch (NoSuchAlgorithmException e) {
		} catch (InvalidKeyException e) {
		} catch (UnsupportedEncodingException e) {
		}
		pckt = new StealthNetPacket(message);
		return pckt;
	}