diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index efa7fbbcdd19292eaaa403f69f83a57138bcfad8..13e29229b89ea334acbcc82c6010c89559a9104a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,34 +2,36 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="7d248efa-573c-4847-b942-df9b4c49b118" name="Default Changelist" comment="">
+      <change afterPath="$PROJECT_DIR$/src/remote/EncryptDecrypt.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ApplicationMain$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ApplicationMain$1.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ApplicationMain.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ApplicationMain.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ChatScreen$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ChatScreen$1.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ChatScreen.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ChatScreen.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ColorPallete.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea$1.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/DrawingArea.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/MenuBar.class" beforeDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/PaintGUI$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/PaintGUI$1.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/PaintGUI.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/PaintGUI.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen$1.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/StartScreen.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/ToolBar.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/GUI/Tools.class" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/META-INF/infinitymonkeys.kotlin_module" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/META-INF/infinitymonkeys.kotlin_module" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ChatUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ChatUpdate.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/Client.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/Client.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ClientUpdate$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ClientUpdate$1.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ClientUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/ClientUpdate.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/client/DrawingUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/client/DrawingUpdate.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IChatController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IChatController.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IChatUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IChatUpdate.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientController$Action.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientController$Action.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IClientController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IDrawingController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IDrawingController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IDrawingUpdate.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/remote/IDrawingUpdate.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ChatController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ChatController.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ClientController$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ClientController$1.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ClientController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/ClientController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/DrawingController.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/DrawingController.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/Server.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/Server.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/out/production/infinitymonkeys/server/User.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/infinitymonkeys/server/User.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/GUI/ChatScreen.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GUI/ChatScreen.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/client/ChatUpdate.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/client/ChatUpdate.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/client/Client.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/client/Client.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/server/DrawingController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/server/DrawingController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/client/EncryptionUpdate.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/client/EncryptionUpdate.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/remote/IChatController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/remote/IChatController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/remote/IChatUpdate.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/remote/IChatUpdate.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/remote/IClientController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/remote/IClientController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/server/ChatController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/server/ChatController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/server/ClientController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/server/ClientController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/server/MySharedKey.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/server/MySharedKey.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/server/User.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/server/User.java" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
@@ -37,6 +39,13 @@
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
     <option name="LAST_RESOLUTION" value="IGNORE" />
   </component>
+  <component name="FileTemplateManagerImpl">
+    <option name="RECENT_TEMPLATES">
+      <list>
+        <option value="Class" />
+      </list>
+    </option>
+  </component>
   <component name="Git.Settings">
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
   </component>
@@ -47,15 +56,6 @@
       </set>
     </option>
   </component>
-  <component name="ProjectConfigurationFiles">
-    <option name="files">
-      <list>
-        <option value="$PROJECT_DIR$/.idea/.gitignore" />
-        <option value="$PROJECT_DIR$/.idea/comp90015-dsass2-infinitymonkeys-remaster.iml" />
-        <option value="$PROJECT_DIR$/.idea/modules.xml" />
-      </list>
-    </option>
-  </component>
   <component name="ProjectId" id="1SawkRB22mTFnhM0v5PRJ8xJhId" />
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
   <component name="PropertiesComponent">
@@ -106,7 +106,7 @@
       <module name="infinitymonkeys" />
       <extension name="coverage">
         <pattern>
-          <option name="PATTERN" value="server.*" />
+          <option name="PATTERN" value="remote.*" />
           <option name="ENABLED" value="true" />
         </pattern>
       </extension>
@@ -139,8 +139,16 @@
       <workItem from="1571815157364" duration="1039000" />
       <workItem from="1571816646909" duration="820000" />
       <workItem from="1571818565591" duration="60000" />
-      <workItem from="1571818658517" duration="1442000" />
+      <workItem from="1571818658517" duration="13454000" />
     </task>
+    <task id="LOCAL-00001" summary="jj">
+      <created>1571821705525</created>
+      <option name="number" value="00001" />
+      <option name="presentableId" value="LOCAL-00001" />
+      <option name="project" value="LOCAL" />
+      <updated>1571821705525</updated>
+    </task>
+    <option name="localTasksCounter" value="2" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -159,6 +167,10 @@
       </map>
     </option>
   </component>
+  <component name="VcsManagerConfiguration">
+    <MESSAGE value="jj" />
+    <option name="LAST_COMMIT_MESSAGE" value="jj" />
+  </component>
   <component name="simpleUML.UMLToolWindowPlugin">
     <General>
       <option name="birdViewUpdateDelay" value="2000" />
diff --git a/out/production/infinitymonkeys/GUI/ChatScreen$1.class b/out/production/infinitymonkeys/GUI/ChatScreen$1.class
index 22f18c553c1c6ac1133f3aeb7189bf14e9f9d15d..eceaff279a128c359ebcb7c8f89cec6b3d83a9e7 100644
Binary files a/out/production/infinitymonkeys/GUI/ChatScreen$1.class and b/out/production/infinitymonkeys/GUI/ChatScreen$1.class differ
diff --git a/out/production/infinitymonkeys/GUI/ChatScreen.class b/out/production/infinitymonkeys/GUI/ChatScreen.class
index 06a5c243a1629f3f56901427e2d48d9d35a013a3..7cd31eeec5f863b8a5cc3cde1938f47145ce075b 100644
Binary files a/out/production/infinitymonkeys/GUI/ChatScreen.class and b/out/production/infinitymonkeys/GUI/ChatScreen.class differ
diff --git a/out/production/infinitymonkeys/GUI/PaintGUI$1.class b/out/production/infinitymonkeys/GUI/PaintGUI$1.class
index f5d4af48346e9a9fec9cf800407482e03e85513f..ed9d50a095c00699761f89c5073cf8fb378da4c4 100644
Binary files a/out/production/infinitymonkeys/GUI/PaintGUI$1.class and b/out/production/infinitymonkeys/GUI/PaintGUI$1.class differ
diff --git a/out/production/infinitymonkeys/GUI/PaintGUI$2.class b/out/production/infinitymonkeys/GUI/PaintGUI$2.class
new file mode 100644
index 0000000000000000000000000000000000000000..0d2c447f0f784d4a5701e22843ffa52ac06ac7a0
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/PaintGUI$2.class differ
diff --git a/out/production/infinitymonkeys/GUI/PaintGUI.class b/out/production/infinitymonkeys/GUI/PaintGUI.class
index f6a84a03a8db02755123f33ad98d85cf2eaa4e2f..9e1daa0e0194580068b687a905ec782fc984dd97 100644
Binary files a/out/production/infinitymonkeys/GUI/PaintGUI.class and b/out/production/infinitymonkeys/GUI/PaintGUI.class differ
diff --git a/out/production/infinitymonkeys/GUI/SerializableImage.class b/out/production/infinitymonkeys/GUI/SerializableImage.class
new file mode 100644
index 0000000000000000000000000000000000000000..73e8a67362f2a5e6c1cae04fb683b5738fb83ddc
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/SerializableImage.class differ
diff --git a/out/production/infinitymonkeys/GUI/StartScreen$1.class b/out/production/infinitymonkeys/GUI/StartScreen$1.class
index fe1bdfe2ee23af168c4895971736d4752ea4eeef..452a3a46496c70057710ae0651db1f3729abf4a9 100644
Binary files a/out/production/infinitymonkeys/GUI/StartScreen$1.class and b/out/production/infinitymonkeys/GUI/StartScreen$1.class differ
diff --git a/out/production/infinitymonkeys/GUI/StartScreen.class b/out/production/infinitymonkeys/GUI/StartScreen.class
index e302c80611c6c4e33c9c8274b874942a80ef7d35..7d098dec40b1bff29ef28d6664e94fb4ac85d34c 100644
Binary files a/out/production/infinitymonkeys/GUI/StartScreen.class and b/out/production/infinitymonkeys/GUI/StartScreen.class differ
diff --git a/out/production/infinitymonkeys/GUI/icon/circle.png b/out/production/infinitymonkeys/GUI/icon/circle.png
new file mode 100644
index 0000000000000000000000000000000000000000..0c23e5a725c3b9d87d0765641e401184be837d24
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/icon/circle.png differ
diff --git a/out/production/infinitymonkeys/GUI/icon/eraser.png b/out/production/infinitymonkeys/GUI/icon/eraser.png
new file mode 100644
index 0000000000000000000000000000000000000000..d5d98df4ca4a1a677baaf83a00fbc903f814119c
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/icon/eraser.png differ
diff --git a/out/production/infinitymonkeys/GUI/icon/freehand.png b/out/production/infinitymonkeys/GUI/icon/freehand.png
new file mode 100644
index 0000000000000000000000000000000000000000..5d162ecd975889c2ff84b0b3e456a4d4115eb82f
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/icon/freehand.png differ
diff --git a/out/production/infinitymonkeys/GUI/icon/line.png b/out/production/infinitymonkeys/GUI/icon/line.png
new file mode 100644
index 0000000000000000000000000000000000000000..31156130a58ec6c455be88f00e470329cba61afd
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/icon/line.png differ
diff --git a/out/production/infinitymonkeys/GUI/icon/oval.png b/out/production/infinitymonkeys/GUI/icon/oval.png
new file mode 100644
index 0000000000000000000000000000000000000000..665c0a0c7c3b1eaa4ba51e6baa6c150f651f8b5f
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/icon/oval.png differ
diff --git a/out/production/infinitymonkeys/GUI/icon/palette.png b/out/production/infinitymonkeys/GUI/icon/palette.png
new file mode 100644
index 0000000000000000000000000000000000000000..813d7ffbe98d40089591256979bd1f21514abdc9
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/icon/palette.png differ
diff --git a/out/production/infinitymonkeys/GUI/icon/rectangle.png b/out/production/infinitymonkeys/GUI/icon/rectangle.png
new file mode 100644
index 0000000000000000000000000000000000000000..94d8278acf49ff157270cc81e0967334936611ec
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/icon/rectangle.png differ
diff --git a/out/production/infinitymonkeys/GUI/icon/square.png b/out/production/infinitymonkeys/GUI/icon/square.png
new file mode 100644
index 0000000000000000000000000000000000000000..38657f5a2779b68ecab7d083e8c112b879bf77bc
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/icon/square.png differ
diff --git a/out/production/infinitymonkeys/GUI/icon/text.png b/out/production/infinitymonkeys/GUI/icon/text.png
new file mode 100644
index 0000000000000000000000000000000000000000..33af1a2708cee9b502580ce4b6380c3a1d8740c8
Binary files /dev/null and b/out/production/infinitymonkeys/GUI/icon/text.png differ
diff --git a/out/production/infinitymonkeys/client/ChatUpdate.class b/out/production/infinitymonkeys/client/ChatUpdate.class
index bc8354438e73505c3b27ae6f6e02e6fdfd4c4a2d..a744ba30c58b4856957d67ba89872ac0f378c60c 100644
Binary files a/out/production/infinitymonkeys/client/ChatUpdate.class and b/out/production/infinitymonkeys/client/ChatUpdate.class differ
diff --git a/out/production/infinitymonkeys/client/Client.class b/out/production/infinitymonkeys/client/Client.class
index bf033c3cb50b8da487fb65398b83ca061464bd9e..3fea35a422c078262d9c24d5adbae30bd6d438f6 100644
Binary files a/out/production/infinitymonkeys/client/Client.class and b/out/production/infinitymonkeys/client/Client.class differ
diff --git a/out/production/infinitymonkeys/client/EncryptionUpdate.class b/out/production/infinitymonkeys/client/EncryptionUpdate.class
new file mode 100644
index 0000000000000000000000000000000000000000..d1cd42f871ec50b9e0a09577dd32bd5e9bfc8527
Binary files /dev/null and b/out/production/infinitymonkeys/client/EncryptionUpdate.class differ
diff --git a/out/production/infinitymonkeys/remote/EncryptDecrypt.class b/out/production/infinitymonkeys/remote/EncryptDecrypt.class
new file mode 100644
index 0000000000000000000000000000000000000000..73e4cf555753915b87f069370969029081c95c1d
Binary files /dev/null and b/out/production/infinitymonkeys/remote/EncryptDecrypt.class differ
diff --git a/out/production/infinitymonkeys/remote/IChatController.class b/out/production/infinitymonkeys/remote/IChatController.class
index 53c3ebdbeb067f1865fe93a3e90ce8ef69e59d0b..65f5e73be02f461363096a33f7b443074d226f8a 100644
Binary files a/out/production/infinitymonkeys/remote/IChatController.class and b/out/production/infinitymonkeys/remote/IChatController.class differ
diff --git a/out/production/infinitymonkeys/remote/IChatUpdate.class b/out/production/infinitymonkeys/remote/IChatUpdate.class
index f84138bb8bf132eae71b572e7f8c37323da8ae93..4d5e55a0f16af2b31b182c22f9cd4c5ee4831c3b 100644
Binary files a/out/production/infinitymonkeys/remote/IChatUpdate.class and b/out/production/infinitymonkeys/remote/IChatUpdate.class differ
diff --git a/out/production/infinitymonkeys/remote/IClientController$Action.class b/out/production/infinitymonkeys/remote/IClientController$Action.class
index 035ddf1381adff501a6e806d89ed427882488ad0..e5ca7f249d69d359e7b08d6ad7d11cceb09bb4e4 100644
Binary files a/out/production/infinitymonkeys/remote/IClientController$Action.class and b/out/production/infinitymonkeys/remote/IClientController$Action.class differ
diff --git a/out/production/infinitymonkeys/remote/IClientController.class b/out/production/infinitymonkeys/remote/IClientController.class
index 66a2945a391c614034311d55d20b59612d99dfdf..b27c8d536a5a2887b0465983a8e4ca8f55dbee37 100644
Binary files a/out/production/infinitymonkeys/remote/IClientController.class and b/out/production/infinitymonkeys/remote/IClientController.class differ
diff --git a/out/production/infinitymonkeys/remote/IEncryptionUpdate.class b/out/production/infinitymonkeys/remote/IEncryptionUpdate.class
new file mode 100644
index 0000000000000000000000000000000000000000..4b96396bf97b41e9a276460afc7e300e72970fa7
Binary files /dev/null and b/out/production/infinitymonkeys/remote/IEncryptionUpdate.class differ
diff --git a/out/production/infinitymonkeys/server/ChatController.class b/out/production/infinitymonkeys/server/ChatController.class
index 1df05bb664aee8674eb208da4de206b6df3bad0d..e19d9b5594db9e967727e2bac0ed0c6270892bc0 100644
Binary files a/out/production/infinitymonkeys/server/ChatController.class and b/out/production/infinitymonkeys/server/ChatController.class differ
diff --git a/out/production/infinitymonkeys/server/ClientController$1.class b/out/production/infinitymonkeys/server/ClientController$1.class
index c8e6540c375c8913bf66fe80fcd2be22f7a11857..ccfca4d98953d8741e0ccf2b74f217d3c7187770 100644
Binary files a/out/production/infinitymonkeys/server/ClientController$1.class and b/out/production/infinitymonkeys/server/ClientController$1.class differ
diff --git a/out/production/infinitymonkeys/server/ClientController.class b/out/production/infinitymonkeys/server/ClientController.class
index 00868b2be4b6151028813f3666fd941cc790deda..4ff0c55d55c0f62e98eb7734c280be3bf2593e7d 100644
Binary files a/out/production/infinitymonkeys/server/ClientController.class and b/out/production/infinitymonkeys/server/ClientController.class differ
diff --git a/out/production/infinitymonkeys/server/MySharedKey.class b/out/production/infinitymonkeys/server/MySharedKey.class
new file mode 100644
index 0000000000000000000000000000000000000000..956b64e2acf75a75257e07e05c60b164dc4ab935
Binary files /dev/null and b/out/production/infinitymonkeys/server/MySharedKey.class differ
diff --git a/out/production/infinitymonkeys/server/Server.class b/out/production/infinitymonkeys/server/Server.class
index 3e54605fe1c8f601825950f467aec87efd4c33cb..4a1b8acffaa4c23eb1d13afad45bab9e5e8d24cb 100644
Binary files a/out/production/infinitymonkeys/server/Server.class and b/out/production/infinitymonkeys/server/Server.class differ
diff --git a/out/production/infinitymonkeys/server/User.class b/out/production/infinitymonkeys/server/User.class
index bb1cfcbe52b605032645164945747218b2160ba8..1f9d467c254e1d5522e06aa714e639f9145b70a4 100644
Binary files a/out/production/infinitymonkeys/server/User.class and b/out/production/infinitymonkeys/server/User.class differ
diff --git a/src/GUI/ChatScreen.java b/src/GUI/ChatScreen.java
index 1c70a5f1b6933fae7b920b0039b8e4af9dc4639a..f07d9ab2557e164ece2dfa7e694febce9a150b13 100644
--- a/src/GUI/ChatScreen.java
+++ b/src/GUI/ChatScreen.java
@@ -1,9 +1,11 @@
 package GUI;
 
 import client.Client;
+import remote.EncryptDecrypt;
 import remote.IChatController;
 import remote.IClientController;
 
+import javax.crypto.SealedObject;
 import javax.swing.*;
 import java.awt.event.*;
 import java.rmi.RemoteException;
@@ -102,14 +104,14 @@ public class ChatScreen {
                     System.out.println("Send button pressed");
 
                     String toUser = sendMessageToComboBox.getSelectedItem().toString();
-
+                    SealedObject messageSealed = EncryptDecrypt.encryptString(message,client.getEncryptionUpdate().getSharedSecretKey());
                     if( toUser.equals("All") )
                     {
-                        chatController.broadcastMessage(client.getUserName(), message);
+                        chatController.broadcastMessage(client.getUserName(), messageSealed);
                     }
                     else
                     {
-                        chatController.sendPrivateMessage(client.getUserName(), toUser, message);
+                        chatController.sendPrivateMessage(client.getUserName(), toUser, messageSealed);
                     }
                 }
                 catch (RemoteException ex)
diff --git a/src/client/ChatUpdate.java b/src/client/ChatUpdate.java
index 2edc3ccdd3c5a1c5262fdc2107d9f28b74b556ce..9447ca5c1f29f9122f1bfdb2eacdc0d538c2995a 100644
--- a/src/client/ChatUpdate.java
+++ b/src/client/ChatUpdate.java
@@ -1,7 +1,9 @@
 package client;
 
+import remote.EncryptDecrypt;
 import remote.IChatUpdate;
 
+import javax.crypto.SealedObject;
 import java.io.Serializable;
 import java.rmi.RemoteException;
 import java.rmi.server.UnicastRemoteObject;
@@ -17,8 +19,9 @@ public class ChatUpdate extends UnicastRemoteObject implements IChatUpdate, Seri
     }
 
     @Override
-    public boolean notifyChat(String fromClient, String message, boolean isPrivate) throws RemoteException
-    {
+    public boolean notifyChat(String fromClient, SealedObject messageSealed, boolean isPrivate) throws RemoteException
+    {   String message;
+        message = EncryptDecrypt.decryptString(messageSealed,client.getEncryptionUpdate().getSharedSecretKey());
         String outputString;
 
         if( isPrivate )
diff --git a/src/client/Client.java b/src/client/Client.java
index 0dca4c8453899959403a33b5051f2fb714e2209d..8fddee58b85b0657835fd1d92ba7d97552f00d7d 100644
--- a/src/client/Client.java
+++ b/src/client/Client.java
@@ -4,10 +4,13 @@ import GUI.ApplicationMain;
 import GUI.ChatScreen;
 import GUI.PaintGUI;
 import GUI.StartScreen;
+import remote.EncryptDecrypt;
 import remote.IChatController;
 import remote.IClientController;
 import remote.IDrawingController;
 
+import javax.crypto.Cipher;
+import javax.crypto.SealedObject;
 import java.rmi.RemoteException;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
@@ -18,6 +21,11 @@ public class Client
 {
     private final String DEFAULT_USERNAME = "Anonymous";
     private final String DEFAULT_SERVER_ADDRESS = "localhost";
+
+    public EncryptionUpdate getEncryptionUpdate() {
+        return encryptionUpdate;
+    }
+
     private final EncryptionUpdate encryptionUpdate;
 
     private String userName;
@@ -147,23 +155,33 @@ public class Client
             System.out.println("User name: " + userName);
             System.out.println("Password: " + password);
 
-            if( clientController.checkPassword(password) )
-            {
-                if( clientController.join(userName, this.chatUpdate, this.clientUpdate, this.drawingUpdate, this.encryptionUpdate) )
-                {
-                    System.out.println("Connected to server");
-
-                    return 1;
-                }
-                else
-                {
-                    return 2;
-                }
-            }
-            else
-            {
-                return 4;
-            }
+           if (clientController.setSharedKey(this.encryptionUpdate)){
+               SealedObject sealedPassword = EncryptDecrypt.encryptString(password,this.encryptionUpdate.getSharedSecretKey());
+
+               if( clientController.checkPassword(sealedPassword) )
+               {
+                   if( clientController.join(userName, this.chatUpdate, this.clientUpdate, this.drawingUpdate) )
+                   {
+                       System.out.println("Connected to server");
+
+                       return 1;
+                   }
+                   else
+                   {
+                       return 2;
+                   }
+               }
+               else
+               {
+                   return 4;
+               }
+
+           }
+           else {
+               return 4;
+           }
+
+
         }
         catch (Exception e)
         {
diff --git a/src/client/EncryptionUpdate.java b/src/client/EncryptionUpdate.java
index 001c1295c64d042cba748e108675cbe14f3a4503..52d1fa52d2f6ee065599c615ec936c707b733e24 100644
--- a/src/client/EncryptionUpdate.java
+++ b/src/client/EncryptionUpdate.java
@@ -14,7 +14,13 @@ public class EncryptionUpdate extends UnicastRemoteObject implements IEncryption
 
     private PrivateKey priv;
     private PublicKey pub;
+
+    public SecretKey getSharedSecretKey() {
+        return sharedSecretKey;
+    }
+
     private SecretKey sharedSecretKey;
+    private Cipher myCipher;
 
     public PublicKey getPub() {
         return pub;
@@ -26,6 +32,8 @@ public class EncryptionUpdate extends UnicastRemoteObject implements IEncryption
             cipher.init(Cipher.DECRYPT_MODE, priv);
             sharedSecretKey = new SecretKeySpec(cipher.doFinal(encryptedSharedSecretKey), "AES");
             System.out.println("Client holds this shared key: "+sharedSecretKey);
+
+
         } catch (NoSuchAlgorithmException e) {
             e.printStackTrace();
         } catch (NoSuchProviderException e) {
@@ -55,4 +63,5 @@ public class EncryptionUpdate extends UnicastRemoteObject implements IEncryption
         }
 
     }
+
 }
diff --git a/src/remote/EncryptDecrypt.java b/src/remote/EncryptDecrypt.java
new file mode 100644
index 0000000000000000000000000000000000000000..cd6af8aca40259ca62e57aab95e91ff4f6779c24
--- /dev/null
+++ b/src/remote/EncryptDecrypt.java
@@ -0,0 +1,59 @@
+package remote;
+
+import javax.crypto.*;
+import java.io.IOException;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+
+public class EncryptDecrypt {
+    public static String decryptString (SealedObject sealedObject, SecretKey key){
+
+        String nonSealedString ="";
+        Cipher cipher = null;
+        try {
+            cipher = Cipher.getInstance("AES");
+            cipher.init(Cipher.DECRYPT_MODE,key);
+            nonSealedString = (String)sealedObject.getObject(cipher);
+
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (NoSuchPaddingException e) {
+            e.printStackTrace();
+        } catch (InvalidKeyException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (IllegalBlockSizeException e) {
+            e.printStackTrace();
+        } catch (BadPaddingException e) {
+            e.printStackTrace();
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+        }
+        return nonSealedString;
+
+    }
+    public static SealedObject encryptString (String string, SecretKey key){
+        SealedObject sealedObject = null;
+
+        Cipher cipher = null;
+        try {
+            cipher = Cipher.getInstance("AES");
+            cipher.init(Cipher.ENCRYPT_MODE,key);
+            sealedObject = new SealedObject(string,cipher);
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        } catch (NoSuchPaddingException e) {
+            e.printStackTrace();
+        } catch (IllegalBlockSizeException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (InvalidKeyException e) {
+            e.printStackTrace();
+        }
+        return sealedObject;
+
+
+    }
+}
diff --git a/src/remote/IChatController.java b/src/remote/IChatController.java
index 82305870e4b5438637dc6b8759ce3235b6a02dd0..6c6bb3802b19e08c81d3a18ab0cfe380ba67036c 100644
--- a/src/remote/IChatController.java
+++ b/src/remote/IChatController.java
@@ -1,12 +1,13 @@
 package remote;
 
+import javax.crypto.SealedObject;
 import java.rmi.Remote;
 import java.rmi.RemoteException;
 
 public interface IChatController extends Remote
 {
-    boolean broadcastMessage(String fromClient, String message) throws RemoteException;
+    boolean broadcastMessage(String fromClient, SealedObject messageSealed) throws RemoteException;
     boolean broadcastMessageUserLogin(String fromClient) throws RemoteException;
     boolean broadcastMessageUserLogout(String fromClient) throws RemoteException;
-    boolean sendPrivateMessage(String fromClient, String toClient, String message) throws RemoteException;
+    boolean sendPrivateMessage(String fromClient, String toClient, SealedObject messageSealed) throws RemoteException;
 }
diff --git a/src/remote/IChatUpdate.java b/src/remote/IChatUpdate.java
index 0c9b54d9daab6367372e1987f2c988a94bcbde8d..ffde71cc00a9bf8ab373df8be513f20d6476a4a2 100644
--- a/src/remote/IChatUpdate.java
+++ b/src/remote/IChatUpdate.java
@@ -1,12 +1,13 @@
 package remote;
 
+import javax.crypto.SealedObject;
 import java.io.Serializable;
 import java.rmi.Remote;
 import java.rmi.RemoteException;
 
 public interface IChatUpdate extends Remote, Serializable
 {
-    boolean notifyChat(String fromClient, String message, boolean isPrivate) throws RemoteException;
+    boolean notifyChat(String fromClient, SealedObject messageSealed, boolean isPrivate) throws RemoteException;
     boolean notifyUserLogin(String fromClient) throws RemoteException;
     boolean notifyUserLogout(String fromClient) throws RemoteException;
 }
diff --git a/src/remote/IClientController.java b/src/remote/IClientController.java
index 07f812571e834b2bdf8c87499121d01095064dca..43f26a23f2eae7854e3abe53a5ce3bb82d26d2a6 100644
--- a/src/remote/IClientController.java
+++ b/src/remote/IClientController.java
@@ -1,5 +1,6 @@
 package remote;
 
+import javax.crypto.SealedObject;
 import java.rmi.Remote;
 import java.rmi.RemoteException;
 
@@ -7,7 +8,7 @@ public interface IClientController extends Remote
 {
     enum Action {KICKOUT, ASSIGNADMIN};
 
-    boolean join(String username, IChatUpdate clientChat, IClientUpdate clientUpdate, IDrawingUpdate clientDrawing, IEncryptionUpdate encryptionUpdate) throws RemoteException;
+    boolean join(String username, IChatUpdate clientChat, IClientUpdate clientUpdate, IDrawingUpdate clientDrawing) throws RemoteException;
 
     void quit(String username) throws RemoteException;
 
@@ -19,5 +20,6 @@ public interface IClientController extends Remote
 
     String getAdmin() throws RemoteException;
 
-    boolean checkPassword(String password) throws RemoteException;
+    boolean checkPassword(SealedObject sealedPassword) throws RemoteException;
+    public boolean setSharedKey(IEncryptionUpdate encryptionUpdate) throws RemoteException;
 }
diff --git a/src/server/ChatController.java b/src/server/ChatController.java
index a2a38a03e75bb952ed298a7f8050029cb38b0324..206bc18cdbc23971de7ee7462fdb9eb500d0e1bd 100644
--- a/src/server/ChatController.java
+++ b/src/server/ChatController.java
@@ -1,8 +1,10 @@
 package server;
 
+import remote.EncryptDecrypt;
 import remote.IChatController;
 import remote.IChatUpdate;
 
+import javax.crypto.SealedObject;
 import java.io.Serializable;
 import java.rmi.RemoteException;
 import java.rmi.server.UnicastRemoteObject;
@@ -17,13 +19,16 @@ public class ChatController extends UnicastRemoteObject implements IChatControll
     }
 
     @Override
-    public boolean broadcastMessage(String fromClient, String message) throws RemoteException
+    public boolean broadcastMessage(String fromClient, SealedObject messageSealed) throws RemoteException
     {
         System.out.print("Broadcasting message to everyone...");
+        int fromClientIndex = server.clientController.getUserIndex(fromClient);
+        String message = EncryptDecrypt.decryptString(messageSealed,server.users.get(fromClientIndex).getSharedSecretKey());
 
         for( User u : server.users )
-        {
-            u.getIChatUpdate().notifyChat(fromClient, message, false);
+        {   u.getSharedSecretKey();
+            SealedObject messageSealedTo = EncryptDecrypt.encryptString(message,u.getSharedSecretKey());
+            u.getIChatUpdate().notifyChat(fromClient, messageSealedTo, false);
         }
 
         System.out.print("...DONE\n");
@@ -68,16 +73,22 @@ public class ChatController extends UnicastRemoteObject implements IChatControll
     }
 
     @Override
-    public boolean sendPrivateMessage(String fromClient, String toClient, String message) throws RemoteException
-    {
+    public boolean sendPrivateMessage(String fromClient, String toClient, SealedObject messageSealed) throws RemoteException
+    {   String message;
         int toClientIndex = server.clientController.getUserIndex(toClient);
         int fromClientIndex = server.clientController.getUserIndex(fromClient);
 
         if( toClientIndex >= 0 && fromClientIndex >= 0 )
         {
-            server.users.get(toClientIndex).getIChatUpdate().notifyChat(fromClient, message, true);
+            message = EncryptDecrypt.decryptString(messageSealed,server.users.get(fromClientIndex).getSharedSecretKey());
+
+            SealedObject messageSealedOutgoingFrom = EncryptDecrypt.encryptString(message,server.users.get(fromClientIndex).getSharedSecretKey());
+
+            SealedObject messageSealedOutgoingTo = EncryptDecrypt.encryptString(message,server.users.get(toClientIndex).getSharedSecretKey());
+
+            server.users.get(toClientIndex).getIChatUpdate().notifyChat(fromClient, messageSealedOutgoingTo, true);
 
-            server.users.get(fromClientIndex).getIChatUpdate().notifyChat(fromClient, message, true);
+            server.users.get(fromClientIndex).getIChatUpdate().notifyChat(fromClient, messageSealedOutgoingFrom, true);
 
             return true;
         }
diff --git a/src/server/ClientController.java b/src/server/ClientController.java
index 2d40ff1c1bd9ee703f860887713428c4c34619ac..15dc3ee3804f9630c471a6231c664804b75c975a 100644
--- a/src/server/ClientController.java
+++ b/src/server/ClientController.java
@@ -2,8 +2,8 @@ package server;
 
 import remote.*;
 
+import javax.crypto.*;
 import java.io.Serializable;
-import java.rmi.Remote;
 import java.rmi.RemoteException;
 import java.rmi.server.UnicastRemoteObject;
 
@@ -16,17 +16,17 @@ public class ClientController extends UnicastRemoteObject implements IClientCont
         this.server = server;
     }
 
+    private SecretKey sharedSecretKey;
+
     @Override
-    public boolean join(String username, IChatUpdate clientChat, IClientUpdate clientUpdate, IDrawingUpdate clientDrawing, IEncryptionUpdate encryptionUpdate) throws RemoteException
+    public boolean join(String username, IChatUpdate clientChat, IClientUpdate clientUpdate, IDrawingUpdate clientDrawing) throws RemoteException
     {
         if( getUserIndex(username) < 0 )
         {
             // user with same username is not connected
             server.chatController.broadcastMessageUserLogin(username);
 
-            new MySharedKey(encryptionUpdate);
-
-            User newUser = new User(username, clientChat, clientUpdate, clientDrawing);
+            User newUser = new User(username, clientChat, clientUpdate, clientDrawing, sharedSecretKey);
 
             server.users.add(newUser);
 
@@ -205,8 +205,11 @@ public class ClientController extends UnicastRemoteObject implements IClientCont
     }
 
     @Override
-    public boolean checkPassword(String password)
+    public boolean checkPassword(SealedObject sealedPassword)
     {
+        System.out.println("Sealed passwords" + sealedPassword);
+        String password = EncryptDecrypt.decryptString(sealedPassword,this.sharedSecretKey);
+        System.out.println("unsealed password"  + password);
         if( server.users.size() == 0 )
         {
             server.setPassword(password);
@@ -222,4 +225,14 @@ public class ClientController extends UnicastRemoteObject implements IClientCont
             return false;
         }
     }
+    public boolean setSharedKey(IEncryptionUpdate encryptionUpdate) throws RemoteException {
+        try {
+            sharedSecretKey = new MySharedKey(encryptionUpdate).getSharedSecretKey();
+            return true;
+
+        }catch (Exception e){
+            return false;
+        }
+
+    }
 }
diff --git a/src/server/MySharedKey.java b/src/server/MySharedKey.java
index e16485e2e87a5ff48c8ea4bd2bfe05757dc7802f..bd4c8abc513f1cd69605dc3da48583e643254988 100644
--- a/src/server/MySharedKey.java
+++ b/src/server/MySharedKey.java
@@ -13,6 +13,11 @@ import java.util.Base64;
 public class MySharedKey {
     private byte[] encryptedSharedSecretKey;
     private IEncryptionUpdate encryptionUpdate;
+
+    public SecretKey getSharedSecretKey() {
+        return sharedSecretKey;
+    }
+
     private SecretKey sharedSecretKey;
 
 
@@ -21,7 +26,7 @@ public class MySharedKey {
         this.sharedSecretKey = new SecretKeySpec(new byte[16], "AES");
         System.out.println(sharedSecretKey);
         this.encryptedSharedSecretKey = wrapKey(encryptionUpdate.getPub());
-        System.out.println("Shared key on server:" + encryptedSharedSecretKey);
+        System.out.println("Shared key on server:" + sharedSecretKey);
         encryptionUpdate.setSharedKey(encryptedSharedSecretKey);
     }
 
diff --git a/src/server/User.java b/src/server/User.java
index 543f26e6c9056a69b382ae8dc4819d4116e95559..c3166674cf9d3cc67d04b547213a5377242088b0 100644
--- a/src/server/User.java
+++ b/src/server/User.java
@@ -4,6 +4,8 @@ import remote.IChatUpdate;
 import remote.IClientUpdate;
 import remote.IDrawingUpdate;
 
+import javax.crypto.SecretKey;
+
 public class User
 {
     private String username;
@@ -12,12 +14,19 @@ public class User
     private IClientUpdate IClientUpdate;
     private boolean isAdmin;
 
-    public User(String username, IChatUpdate IChatUpdate, IClientUpdate IClientUpdate, IDrawingUpdate IDrawingUpdate)
+    public SecretKey getSharedSecretKey() {
+        return sharedSecretKey;
+    }
+
+    private SecretKey sharedSecretKey;
+
+    public User(String username, IChatUpdate IChatUpdate, IClientUpdate IClientUpdate, IDrawingUpdate IDrawingUpdate, SecretKey sharedSecretKey)
     {
         this.username = username;
         this.IChatUpdate = IChatUpdate;
         this.IDrawingUpdate = IDrawingUpdate;
         this.IClientUpdate = IClientUpdate;
+        this.sharedSecretKey = sharedSecretKey;
         this.isAdmin = false;
     }