public void run() {

			// to loop until LOGOUT
			boolean keepGoing = true;
			while (keepGoing) {
				String message = "";
				try {
					// diavazoume to public key to client
					PublicKey clientPublicKey = (PublicKey) sInput.readObject();

					cm = (ChatMessage) sInput.readObject();

					byte[] receivedMsg = Base64.getDecoder().decode(
							cm.getMessage().getBytes());

					// ta prwta 4 bytes einai to mhkos ths upografhs
					byte[] signatureLengthBytes = Arrays.copyOf(receivedMsg, 4);
					int signatureLength = ArrayUtils
							.byteArrayToInt(signatureLengthBytes);

					// h upografh ksekinaei meta ta 4 bytes ews to mhkos pou
					// vrhkame panw
					byte[] sentSignature = Arrays.copyOfRange(receivedMsg, 4,
							4 + signatureLength);

					// to upoloipo wrapped message
					byte[] wrappedMessage = Arrays.copyOfRange(receivedMsg,
							4 + signatureLength, receivedMsg.length);

					// to mhnuma se plain text
					byte[] decryptedMsg = SecurityUtils.decryptMessage(
							wrappedMessage, keyPair.getPrivate());

					// kanoume pali hash gia na eleksoume an einai ola kala
					byte[] digest = MessageDigest.getInstance("SHA1").digest(
							decryptedMsg);

					// epivevaiwnoume thn upografh kai petame exception an dn
					// einai swsth
					Signature sig = Signature.getInstance("SHA1withRSA");
					sig.initVerify(clientPublicKey);
					sig.update(digest);

					if (!sig.verify(sentSignature))
						throw new SignatureException("Signature invalid");

					// an den eixame exception ws edw shmainei oti ola phgan
					// kala
					// opote dhmiourgoume to mhnuma se string
					message = new String(decryptedMsg);

				} catch (IOException | ClassNotFoundException
						| NoSuchAlgorithmException | InvalidKeyException
						| SignatureException | NoSuchPaddingException
						| IllegalBlockSizeException | BadPaddingException e) {
					display(username + " An exception has occured: " + e);
					break;
				}

				// Switch on the type of message receive
				switch (cm.getType()) {

				case ChatMessage.MESSAGE:
					broadcast(username + ": " + message);
					break;
				case ChatMessage.LOGOUT:
					display(username + " disconnected with a LOGOUT message.");
					keepGoing = false;
					break;
				case ChatMessage.WHOISIN:
					writeMsg("List of the users connected at "
							+ sdf.format(new Date()) + "\n");
					// scan al the users connected
					for (int i = 0; i < al.size(); ++i) {
						ClientThread ct = al.get(i);
						writeMsg((i + 1) + ") " + ct.username + " since "
								+ ct.date);
					}
					break;
				}
			}
			// remove myself from the arrayList containing the list of the
			// connected Clients
			remove(id);
			close();
		}