Index: /trunk/src/org/expeditee/assets/resources-public/framesets/authentication/4.exp
===================================================================
--- /trunk/src/org/expeditee/assets/resources-public/framesets/authentication/4.exp	(revision 1356)
+++ /trunk/src/org/expeditee/assets/resources-public/framesets/authentication/4.exp	(revision 1357)
@@ -1,8 +1,8 @@
-V 177
+V 181
 p 40
 U authadmin
 D 07Jan2019[14:34]
 M nobody
-d 06May2019[11:49]
+d 07May2019[11:27]
 B 100 100 39 100
 Z
@@ -167,5 +167,5 @@
 s 29Apr2019[15:40.59]
 d 0 0 0 100
-P 2 380
+P 16 380
 e 100 59 59 100
 N 380
@@ -179,5 +179,5 @@
 s 29Apr2019[15:40.59]
 d 0 0 0 100
-P 977 380
+P 991 380
 e 100 59 59 100
 N 380
@@ -205,4 +205,5 @@
 M 300
 h 1.0
+p 44
 _ph Password Piece Two
 
@@ -224,4 +225,5 @@
 M 300
 h 1.0
+p 44
 _ph Password Piece One
 
@@ -301,16 +303,85 @@
 Z
 
-ActiveTime:01:24:42
+ActiveTime:01:24:43
 DarkTime:02:32:46
-49:58:429 719 350 Ld
-49:58:430 719 350 Rd
-49:58:932 719 350 Ru
-49:59:027 719 350 Lu
-50:00:284 905 338 Md
-50:00:355 905 338 Rd
-50:00:508 905 338 Mu
-50:00:523 905 338 Ru
-50:05:239 1187 159 Md
-50:05:308 1187 159 Rd
-50:05:484 1187 159 Ru
-50:05:485 1187 159 Mu
+27:47:127 281 438 Ld
+27:47:238 281 438 Rd
+27:47:374 281 438 Ru
+27:47:382 281 438 Lu
+27:48:551 629 275 Rd
+27:48:646 629 275 Ru
+27:51:670 129 185 Md
+27:51:790 129 185 Mu
+27:52:711 137 262 Md
+27:52:919 137 258 Mu
+27:53:574 142 203 Md
+27:53:734 142 203 Mu
+28:03:310 1265 166 kSHIFT
+28:03:810 1265 166 kSHIFT
+28:03:843 1265 166 kSHIFT
+28:03:876 1265 166 kSHIFT
+28:03:909 1265 166 kSHIFT
+28:03:942 1265 166 kSHIFT
+28:03:975 1265 166 kSHIFT
+28:03:982 1265 166 kA
+28:04:310 1278 166 kU
+28:04:478 1287 166 kT
+28:04:574 1292 166 kH
+28:04:798 1301 166 kSHIFT
+28:04:894 1301 166 kA
+28:05:158 1314 166 kD
+28:05:390 1323 166 kM
+28:05:919 1337 166 kBACKSPACE
+28:06:419 1323 166 kBACKSPACE
+28:06:458 1314 166 kBACKSPACE
+28:06:489 1301 166 kBACKSPACE
+28:06:520 1292 166 kBACKSPACE
+28:06:551 1287 166 kBACKSPACE
+28:06:583 1278 166 kBACKSPACE
+28:06:616 1265 166 kBACKSPACE
+28:06:649 1265 166 kBACKSPACE
+28:06:682 1265 166 kBACKSPACE
+28:06:694 1265 166 kSHIFT
+28:06:846 1265 166 kT
+28:07:048 1276 166 kO
+28:07:230 1285 166 kG
+28:07:374 1294 166 kG
+28:07:439 1303 166 kL
+28:07:582 1308 166 kE
+28:07:734 1316 166 kSHIFT
+28:07:806 1316 166 kA
+28:08:031 1329 166 kU
+28:08:174 1338 166 kT
+28:08:287 1343 166 kH
+28:08:639 1352 166 kCTRL
+28:08:799 1352 166 kA
+28:10:503 1327 164 Md
+28:10:677 1327 164 Mu
+28:11:576 1264 173 Md
+28:11:701 1261 173 Mu
+28:16:638 1268 163 kSHIFT
+28:16:902 1268 163 kT
+28:17:206 1279 163 kO
+28:17:470 1288 163 kG
+28:17:614 1297 163 kG
+28:17:718 1306 163 kL
+28:17:854 1311 163 kE
+28:18:006 1319 163 kSHIFT
+28:18:094 1319 163 kA
+28:18:261 1332 163 kU
+28:18:430 1341 163 kT
+28:18:470 1346 163 kH
+28:18:742 1355 163 kCTRL
+28:18:918 1355 163 kA
+28:20:975 1318 166 Ld
+28:21:118 1318 166 Lu
+28:26:463 802 382 Md
+28:26:638 802 382 Mu
+28:28:223 802 382 kALT
+28:28:631 802 382 kRIGHT_ARROW
+28:44:544 816 382 Md
+28:44:766 816 382 Mu
+28:47:295 1281 159 Md
+28:47:559 1281 159 Rd
+28:47:910 1281 159 Ru
+28:47:958 1281 159 Mu
Index: /trunk/src/org/expeditee/auth/Actions.java
===================================================================
--- /trunk/src/org/expeditee/auth/Actions.java	(revision 1356)
+++ /trunk/src/org/expeditee/auth/Actions.java	(revision 1357)
@@ -22,4 +22,5 @@
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -38,4 +39,5 @@
 import org.expeditee.auth.account.Authenticate.AuthenticationResult;
 import org.expeditee.auth.account.Create;
+import org.expeditee.auth.account.Create.CreateResult;
 import org.expeditee.auth.account.Password;
 import org.expeditee.auth.gui.MailBay;
@@ -49,4 +51,5 @@
 import org.expeditee.items.Text;
 import org.expeditee.settings.UserSettings;
+import org.expeditee.settings.identity.passwordrecovery.Colleagues;
 import org.expeditee.settings.identity.secrets.KeyList;
 import org.expeditee.stats.Formatter;
@@ -78,4 +81,10 @@
 		Mail.sendMail(mail, recipient);
 		MessageBay.displayMessage("Test message sent.");
+	}
+	public static void SetPWColleagues(String colleagueOne, String colleagueTwo) {
+		Colleagues.Colleague_One.set(colleagueOne);
+		Colleagues.Colleague_Two.set(colleagueTwo);
+		Colleagues.Colleague_One_Email.set("bnemhauser@gmail.com");
+		Colleagues.Colleague_Two_Email.set("bnemhauser@gmail.com");
 	}
 	
@@ -181,7 +190,11 @@
 			}
 			
-			Create.createAccount(userData);
-			Authenticate.login(userData);
-			AuthenticatorBrowser.Authenticated = true;
+			CreateResult result = Create.createAccount(userData);
+			if (result == CreateResult.SuccessCreateAccount) {
+				Authenticate.login(userData);
+				AuthenticatorBrowser.Authenticated = true;
+			} else {
+				MessageBay.errorMessage(result.toString());
+			}
 		} else {
 			MessageBay.errorMessage("Please fill out all the supplied text boxes.");
@@ -196,15 +209,14 @@
 	 */
 	public static void AuthLogin() {
-		final Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems();
-		final Optional<Map<AuthenticationTag, String>> userdata = AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username, AuthenticationTag.Password);
+		Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems();
+		Optional<Map<AuthenticationTag, String>> userdata = AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username, AuthenticationTag.Password);
 		if (userdata.isPresent()) {
 			AuthenticationResult result = Authenticate.login(userdata.get());
 			if (result == AuthenticationResult.SuccessLogin) {
 				MessageBay.displayMessage(result.toString());
+				AuthenticatorBrowser.Authenticated = true;
 			} else {
 				MessageBay.errorMessage(result.toString());
 			}
-			//login(userdata.get());
-			AuthenticatorBrowser.Authenticated = true;
 		} else {
 			MessageBay.errorMessage("Please fill out all the supplied text boxes.");
@@ -258,7 +270,8 @@
 	}
 	
-	public static void AuthResetPasswordPt1() {
+	public static void AuthDistributeIntergalacticNumber() {
 		Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems();
-		Optional<Map<AuthenticationTag, String>> userdata = AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username);
+		Optional<Map<AuthenticationTag, String>> userdata = 
+				AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username);
 		if (userdata.isPresent()) {
 			Map<AuthenticationTag, String> userData = userdata.get();
@@ -267,23 +280,36 @@
 			userData.put(AuthenticationTag.Email, email);
 			Password.generateAndDeliverIntergalacticNumber(userData);
-			MessageBay.displayMessage("A Intergalactic number has been sent to the email associated with your account.  Enter it below to proceed.");
-		}
-	}
-	
-	public static void AuthResetPasswordPt2() {
+			MessageBay.displayMessage("A identity number has been sent to the email "
+					+ "associated with your account.  Enter it below to proceed.");
+		}
+	}
+	
+	public static void AuthSubmitIntergalacticNumber() {
 		Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems();
-		Optional<Map<AuthenticationTag, String>> userdata = AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username, 
-				AuthenticationTag.IntergalacticNumber, AuthenticationTag.NewPassword, AuthenticationTag.NewPasswordAgain);
+		Optional<Map<AuthenticationTag, String>> userdata = 
+				AuthenticationTag.fetchUserData(textItems, false, AuthenticationTag.Username, 
+						AuthenticationTag.IntergalacticNumber);
 		if (userdata.isPresent()) {
-			Map<AuthenticationTag, String> userData = userdata.get();
-			String username = userData.get(AuthenticationTag.Username);
-			String email = getEmailFromUsername(username);
-			userData.put(AuthenticationTag.Email, email);
-			Password.confirmIntergalacticNumberAndGenerateSubstituteAccount(userData);
+			Map<AuthenticationTag, String> tags = userdata.get();
+			String username = tags.get(AuthenticationTag.Username);
+			String intergalacticNumber = tags.get(AuthenticationTag.IntergalacticNumber);
+			boolean match = false;
+			try {
+				match = AuthenticatorBrowser.getInstance().confirmIntergalaticNumber(username, intergalacticNumber);
+			} catch (NoSuchAlgorithmException | KeyStoreException | CertificateException | ClassNotFoundException
+					| IOException | SQLException e) {
+				e.printStackTrace();
+				return;
+			}
+			if (!match) {
+				MessageBay.errorMessage("The provided identity number does not match the one stored on file.");
+				return;
+			}
+			String[] colleagues = getPasswordColleaguesFromUsername(username);
+			Password.confirmIntergalacticNumberAndAlertColleagues(userdata.get(), colleagues);
 		}
 	}
 	
 	private static String getEmailFromUsername(String username) {
-		Collection<Text> textItems = DisplayController.getCurrentFrame().getTextItems();
 		Path credentialsDirPath = Paths.get(FrameIO.PROFILE_PATH).resolve(username).resolve(username + "-credentials");
 		Path credentialsFilePath = credentialsDirPath.resolve("credentials.inf");
@@ -303,5 +329,5 @@
 		int number = Integer.parseInt(fileName.replace(".exp", ""));
 		Frame credentialsFrame = FrameIO.LoadFrame(username + number, FrameIO.PROFILE_PATH);
-		textItems = credentialsFrame.getTextItems();
+		Collection<Text> textItems = credentialsFrame.getTextItems();
 		textItems.removeIf(text -> !text.getText().startsWith("Email: "));
 		if (textItems.isEmpty()) {
@@ -313,4 +339,42 @@
 			return email;
 		}
+	}
+	
+	private static String[] getPasswordColleaguesFromUsername(String username) {
+		Path credentialsDirPath = Paths.get(FrameIO.PROFILE_PATH).resolve(username).resolve(username + "-credentials");
+		Path credentialsFilePath = credentialsDirPath.resolve("pwcolleagues.inf");
+		String fileName = null;
+		if (credentialsFilePath.toFile().exists()) {
+			try (Scanner in = new Scanner(credentialsFilePath)) {
+				fileName = in.nextLine();
+			} catch (IOException e) {
+				MessageBay.errorMessage("Unable to password colleague frame for specified user, are they registered on this computer?");
+				return null;
+			}
+		} else {
+			MessageBay.errorMessage("Unable to password colleague frame for specified user, are they registered on this computer?");
+			return null;
+		}
+		
+		int number = Integer.parseInt(fileName.replace(".exp", ""));
+		Frame pwColleagueFrame = FrameIO.LoadFrame(username + number, FrameIO.PROFILE_PATH);
+		Collection<Text> textItems = pwColleagueFrame.getTextItems();
+		textItems.removeIf(text -> !text.getText().startsWith("Colleague"));
+		
+		String[] ret = new String[4];
+		Iterator<Text> it = textItems.iterator();
+		while(it.hasNext()) {
+			String content = it.next().getText().toLowerCase().trim();
+			if (content.contains("colleague_one:")) {
+				ret[0] = content.replace("colleague_one:", "").trim();
+			} else if (content.contains("colleague_two:")) {
+				ret[1] = content.replace("colleague_two:", "").trim();
+			} else if (content.contains("colleague_one_email:")) {
+				ret[2] = content.replace("colleague_one_email:", "").trim();
+			} else if (content.contains("colleague_two_email:")) {
+				ret[3] = content.replace("colleague_two_email:", "").trim();
+			}
+		}
+		return ret;
 	}
 	
Index: /trunk/src/org/expeditee/auth/AuthenticatorBrowser.java
===================================================================
--- /trunk/src/org/expeditee/auth/AuthenticatorBrowser.java	(revision 1356)
+++ /trunk/src/org/expeditee/auth/AuthenticatorBrowser.java	(revision 1357)
@@ -151,4 +151,5 @@
 			FileNotFoundException, IOException {
 		// Fetch desired password
+		@SuppressWarnings("resource")
 		Scanner in = new Scanner(System.in);
 		System.out.println("No administrative password set.");
@@ -164,5 +165,5 @@
 				// Register account.
 				putKey(ADMINACCOUNT, password, new SecretKeySpec("null".getBytes(), AsymmetricAlgorithm));
-				in.close();
+				//in.close();
 				passwordIsSet = true;
 				break;
@@ -327,15 +328,17 @@
 	}
 	
-	public final boolean confirmIntergalaticNumber(final String username, final String email, final String intergalacticNumber) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, FileNotFoundException, IOException {
+	public final boolean confirmIntergalaticNumber(final String username, final String intergalacticNumber) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, FileNotFoundException, IOException {
 		try {
-			final KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(intergalacticNumber.toCharArray());
-			final KeyStore.SecretKeyEntry entry = (SecretKeyEntry) keyStore.getEntry(email + username, entryPassword);
-			if (entry == null) { 
+			KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(intergalacticNumber.toCharArray());
+			KeyStore.SecretKeyEntry entry = (SecretKeyEntry) keyStore.getEntry(username + "_IntergalacticNumber", entryPassword);
+			if (entry == null) {
 				return false;
 			} else if (Arrays.equals(entry.getSecretKey().getEncoded(), TRUE)) {
-				keyStore.deleteEntry(email + username);
+				keyStore.deleteEntry(username + "_IntergalacticNumber");
 				keyStore.store(new FileOutputStream(FrameIO.PARENT_FOLDER + KEYSTOREFILENAME), "ExpediteeAuthPassword".toCharArray());
 				return true;
-			} else { return false; }
+			} else {
+				return false;
+			}
 		} catch (final UnrecoverableEntryException e) {
 			return false;
@@ -351,7 +354,7 @@
 		
 		// store intergalactic number
-		final KeyStore.SecretKeyEntry entry = new KeyStore.SecretKeyEntry(new SecretKeySpec(TRUE, SymmetricAlgorithm));
-		final KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(intergalacticNumber.toCharArray());
-		keyStore.setEntry(email + username, entry, entryPassword);
+		KeyStore.SecretKeyEntry entry = new KeyStore.SecretKeyEntry(new SecretKeySpec(TRUE, SymmetricAlgorithm));
+		KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(intergalacticNumber.toCharArray());
+		keyStore.setEntry(username + "_IntergalacticNumber", entry, entryPassword);
 		keyStore.store(new FileOutputStream(FrameIO.PARENT_FOLDER + KEYSTOREFILENAME), "ExpediteeAuthPassword".toCharArray());
 		
Index: /trunk/src/org/expeditee/auth/Mail.java
===================================================================
--- /trunk/src/org/expeditee/auth/Mail.java	(revision 1356)
+++ /trunk/src/org/expeditee/auth/Mail.java	(revision 1357)
@@ -33,4 +33,6 @@
 import javax.crypto.IllegalBlockSizeException;
 import javax.crypto.NoSuchPaddingException;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
 
 import org.expeditee.auth.gui.MailBay;
@@ -54,12 +56,47 @@
 	}
 	
+	public static void sendOneOffMail(MailEntry mail, String colleagueName, byte[] key) {
+		// Ensure dead drop area is set up.
+		Path databaseFileDirPath = ensureDeadDrops(colleagueName);
+		
+		// Ensure the database file exists.
+		Path databaseFilePath = ensureDatabaseFile(colleagueName, databaseFileDirPath);
+		
+		// Create secret key.
+		SecretKey secretKey = new SecretKeySpec(key, SymmetricAlgorithm);
+		
+		// Send message
+		sendMail(mail, secretKey, databaseFilePath);
+	}
+	
 	public static void sendMail(MailEntry mail, String colleagueName) {
 		// Ensure dead drop area is set up.
-		String me = UserSettings.UserName.get().toLowerCase();
-		String them = colleagueName.toLowerCase();
-		Path databaseFileDirPath = Paths.get(FrameIO.DEAD_DROPS_PATH).resolve(me + "+" + them);
-		if (!databaseFileDirPath.toFile().exists()) {
-			databaseFileDirPath = Paths.get(FrameIO.DEAD_DROPS_PATH).resolve(them + "+" + me);
-		}
+		Path databaseFileDirPath = ensureDeadDrops(colleagueName);
+		
+		// Ensure the database file exists.
+		Path databaseFilePath = ensureDatabaseFile(colleagueName, databaseFileDirPath);
+		
+		// Obtain public key
+		PublicKey publicKey = null;
+		try {
+			publicKey = AuthenticatorBrowser.getInstance().getPublicKey(colleagueName);
+		} catch (InvalidKeySpecException | NoSuchAlgorithmException | KeyStoreException | CertificateException
+				| ClassNotFoundException | IOException | SQLException e) {
+			System.err.println("Error while sending message.  Unable to obtain public key for colleague " +  
+				colleagueName + ".  Exception message: " + e.getMessage());
+			return;
+		}
+		
+		// Check we got public key
+		if (publicKey == null) {
+			System.err.println("Error while sending message.  Unable to obtain public key for colleague.  Have you exchanged contact details?");
+			return;
+		}
+		
+		// Send message
+		sendMail(mail, publicKey, databaseFilePath);
+	}
+
+	private static Path ensureDatabaseFile(String colleagueName, Path databaseFileDirPath) {
 		Path databaseFilePath = databaseFileDirPath.resolve(colleagueName + ".db");
 		File databaseFile = databaseFilePath.toFile();
@@ -86,24 +123,15 @@
 			}
 		}
-		
-		// Obtain public key
-		PublicKey publicKey = null;
-		try {
-			publicKey = AuthenticatorBrowser.getInstance().getPublicKey(colleagueName);
-		} catch (InvalidKeySpecException | NoSuchAlgorithmException | KeyStoreException | CertificateException
-				| ClassNotFoundException | IOException | SQLException e) {
-			System.err.println("Error while sending message.  Unable to obtain public key for colleague " +  
-				colleagueName + ".  Exception message: " + e.getMessage());
-			return;
-		}
-		
-		// Check we got public key
-		if (publicKey == null) {
-			System.err.println("Error while sending message.  Unable to obtain public key for colleague.  Have you exchanged contact details?");
-			return;
-		}
-		
-		// Send message
-		sendMail(mail, publicKey, databaseFilePath);
+		return databaseFilePath;
+	}
+
+	private static Path ensureDeadDrops(String colleagueName) {
+		String me = UserSettings.UserName.get().toLowerCase();
+		String them = colleagueName.toLowerCase();
+		Path databaseFileDirPath = Paths.get(FrameIO.DEAD_DROPS_PATH).resolve(me + "+" + them);
+		if (!databaseFileDirPath.toFile().exists()) {
+			databaseFileDirPath = Paths.get(FrameIO.DEAD_DROPS_PATH).resolve(them + "+" + me);
+		}
+		return databaseFileDirPath;
 	}
 	
@@ -111,8 +139,4 @@
 		try {
 			Cipher cipher = Cipher.getInstance(AsymmetricAlgorithm + AsymmetricAlgorithmParameters);
-			
-			// encrypt the necessary parts of the message
-			//cipher.init(Cipher.ENCRYPT_MODE, key);
-			//String time = Base64.getEncoder().encodeToString(cipher.doFinal(mail.timestamp.getBytes()));
 			cipher.init(Cipher.ENCRYPT_MODE, key);
 			String sender = Base64.getEncoder().encodeToString(cipher.doFinal(mail.sender.getBytes()));
@@ -134,19 +158,5 @@
 			
 			// write to mail database
-			Connection c = DriverManager.getConnection("jdbc:sqlite:" + databaseFile);
-			String sql = "INSERT INTO EXPMAIL (TIME,SND,REC,MSG,MSG2,OPTS,OPTSVAL) VALUES (?, ?, ?, ?, ?, ?, ?);";
-			PreparedStatement statement = c.prepareStatement(sql);
-			statement.setString(1, mail.timestamp);
-			statement.setString(2, sender);
-			statement.setString(3, rec);
-			statement.setString(4, message);
-			statement.setString(5, message2);
-			String opts = Arrays.toString(options.keySet().toArray());
-			statement.setString(6, opts);
-			String optsval = Arrays.toString(options.values().toArray());
-			statement.setString(7, optsval);
-			statement.execute();
-			statement.close();
-			c.close();			
+			writeToMailDatabase(mail, databaseFile, sender, rec, message, message2, options);			
 		} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException | SQLException e) {
 			e.printStackTrace();
@@ -154,4 +164,51 @@
 	}
 	
+	private static void sendMail(MailEntry mail, SecretKey key, Path databaseFile) {
+		try {
+			//	Encrypt message.
+			Cipher cipher = Cipher.getInstance(SymmetricAlgorithm + SymmetricAlgorithmParameters);
+			cipher.init(Cipher.ENCRYPT_MODE, key);
+			String sender = "=" + Base64.getEncoder().encodeToString(cipher.doFinal(mail.sender.getBytes()));
+			cipher.init(Cipher.ENCRYPT_MODE, key);
+			String rec = Base64.getEncoder().encodeToString(cipher.doFinal(mail.receiver.getBytes()));
+			cipher.init(Cipher.ENCRYPT_MODE, key);
+			String message = Base64.getEncoder().encodeToString(cipher.doFinal(mail.message.getBytes()));
+			cipher.init(Cipher.ENCRYPT_MODE, key);
+			String message2 = Base64.getEncoder().encodeToString(cipher.doFinal(mail.message2.getBytes()));			
+			Map<String, String> options = new HashMap<String, String>(); 
+			for (String label: mail.options.keySet()) {
+				cipher.init(Cipher.ENCRYPT_MODE, key);
+				String labelEncrypted = Base64.getEncoder().encodeToString(cipher.doFinal(label.getBytes()));
+				cipher.init(Cipher.ENCRYPT_MODE, key);
+				String actionNameEncrypted = Base64.getEncoder().encodeToString(cipher.doFinal(mail.options.get(label).getBytes()));
+				options.put(labelEncrypted, actionNameEncrypted);
+			}
+			
+			//	Write to mail database.
+			writeToMailDatabase(mail, databaseFile, sender, rec, message, message2, options);
+		} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException | SQLException e) {
+			e.printStackTrace();
+		}
+	}
+
+	private static void writeToMailDatabase(MailEntry mail, Path databaseFile, String sender, String rec,
+			String message, String message2, Map<String, String> options) throws SQLException {
+		Connection c = DriverManager.getConnection("jdbc:sqlite:" + databaseFile);
+		String sql = "INSERT INTO EXPMAIL (TIME,SND,REC,MSG,MSG2,OPTS,OPTSVAL) VALUES (?, ?, ?, ?, ?, ?, ?);";
+		PreparedStatement statement = c.prepareStatement(sql);
+		statement.setString(1, mail.timestamp);
+		statement.setString(2, sender);
+		statement.setString(3, rec);
+		statement.setString(4, message);
+		statement.setString(5, message2);
+		String opts = Arrays.toString(options.keySet().toArray());
+		statement.setString(6, opts);
+		String optsval = Arrays.toString(options.values().toArray());
+		statement.setString(7, optsval);
+		statement.execute();
+		statement.close();
+		c.close();
+	}
+		
 	/**
 	 * Gets the mail messages that the specified user is able to read.
@@ -230,4 +287,5 @@
 		public String message2;
 		public Map<String, String> options;
+		public MailEntry subEntry;
 		
 		public MailEntry(String timestamp, String sender, String rec, String message, String message2, Map<String, String> options) {
Index: /trunk/src/org/expeditee/auth/account/Password.java
===================================================================
--- /trunk/src/org/expeditee/auth/account/Password.java	(revision 1356)
+++ /trunk/src/org/expeditee/auth/account/Password.java	(revision 1357)
@@ -24,6 +24,7 @@
 import org.expeditee.gui.FrameIO;
 import org.expeditee.gui.MessageBay;
+import org.ngikm.cryptography.CryptographyConstants;
 
-public class Password {
+public class Password implements CryptographyConstants {
 	/*
 	 * Changes the recorded password for a user in the key store.
@@ -91,22 +92,7 @@
 	}
 	
-	public static void confirmIntergalacticNumberAndGenerateSubstituteAccount(Map<AuthenticationTag, String> userData) {
-		String username = userData.get(AuthenticationTag.Username);
-		String email = userData.get(AuthenticationTag.Email);
-		String intergalacticNumber = userData.get(AuthenticationTag.IntergalacticNumber);
-		String newPassword = userData.get(AuthenticationTag.NewPassword);
-		String newPasswordAgain = userData.get(AuthenticationTag.NewPasswordAgain);
-		
-		try {
-			boolean match = AuthenticatorBrowser.getInstance().confirmIntergalaticNumber(username, email, intergalacticNumber);		
-			if (match) {
-				MessageBay.displayMessage(":)");
-			} else {
-				MessageBay.displayMessage(":(");
-			}
-		} catch (NoSuchAlgorithmException | KeyStoreException | CertificateException | ClassNotFoundException
-				| IOException | SQLException e) {
-			e.printStackTrace();
-		}
+	public static void confirmIntergalacticNumberAndAlertColleagues(Map<AuthenticationTag, String> userData, String[] colleagues) {
+		System.err.println("Colleague One: " + colleagues[0] + " @" + colleagues[2]);
+		System.err.println("Colleague Two: " + colleagues[1] + " @" + colleagues[3]);
 	}
 }
Index: /trunk/src/org/expeditee/gui/FrameIO.java
===================================================================
--- /trunk/src/org/expeditee/gui/FrameIO.java	(revision 1356)
+++ /trunk/src/org/expeditee/gui/FrameIO.java	(revision 1357)
@@ -127,5 +127,5 @@
 	public static final int MAX_CACHE = 100;
 	private static HashMap<String, Frame> _Cache = new FrameCache();
-	private static boolean ENABLE_CACHE = true;
+	private static final boolean ENABLE_CACHE = true;
 	private static boolean _UseCache = true;
 	private static boolean _SuspendedCache = false;
