@Override
	public void run() {
		try {			
			System.out.println("Writing to client...");
			DataOutputStream streamOut = new DataOutputStream(socket.getOutputStream());
			streamOut.writeBytes(e.toString() + "#" + c.toString() + '\n');

			boolean done = false;
			String toClient = "";
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			while (!done) {	
				System.out.println("server: type, enter .bye to quit");
				toClient = in.readLine();
				System.out.print("ENCRYPTED " + toClient);
				if (!toClient.equalsIgnoreCase(".bye")) {
					ArrayList<BigInteger> encryptedNumList = MiniRSA.encrypt(toClient, cli_c, cli_e);
					toClient = "";
					for (int i = 0; i < encryptedNumList.size(); i++) {
						toClient += encryptedNumList.get(i).toString();
						toClient += " ";
					}
					System.out.println(" to " + toClient);
				}
				else done = true;
				streamOut.writeBytes(toClient + '\n');
			}
			streamOut.close(); 
			socket.close();
		} 
		catch (IOException e) {
			System.err.println("Unable to write to " + socket); }

	}