@Override
	public void run() {
		try {
			System.out.println("Writing to server...");
			DataOutputStream streamOut = new DataOutputStream(socket.getOutputStream());
			streamOut.writeBytes(e.toString() + "#" + c.toString() + '\n');
			
			String toServer = "";
			BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
			boolean done = false;
			while (!done) {	
				System.out.println("client: type, enter .bye to quit");
				toServer = in.readLine();
				System.out.print("ENCRYPTED " + toServer);				
				if (!toServer.equalsIgnoreCase(".bye")) {
					ArrayList<BigInteger> encryptedNumList = MiniRSA.encrypt(toServer, srv_c, srv_e);
					toServer = "";
					for (int i = 0; i < encryptedNumList.size(); i++) {
						toServer += encryptedNumList.get(i).toString();
						toServer += " ";
					}
					System.out.println(" to " + toServer);
				}
				else done = true;
				streamOut.writeBytes(toServer + '\n');
			}
			streamOut.close(); 
			socket.close();
		} 
		catch (IOException e) {
			System.err.println("Unable to write to " + socket); }

	}