private String hash(char[] arg){
		MessageDigest md;
		byte[] passbyte = null;
		byte[] encoded = null;
		String hash = "";
		try {
			
			// TODO: Check integrity of SHA256 vs MD5
	    	md = MessageDigest.getInstance("SHA-256"); // Creates an SHA-256 generator
	    	passbyte = new String(arg).getBytes();
	    	encoded = md.digest(passbyte);
		} catch (NoSuchAlgorithmException e) {
			md = null;
			passbyte = null;
			
			if(e.getCause() != null){
			JOptionPane.showMessageDialog(frame,
				    "The application has encountered an internal algorithm security error.  Please report this to the developers.\n"
				    + "CAUSE: " + e.getCause().toString() + "\n"
				    + "MESSAGE: " + e.getMessage().toString() + "\n",
				    "An Error Occurred",
				    JOptionPane.ERROR_MESSAGE);
			}
			else {
				JOptionPane.showMessageDialog(frame,
					    "The application has encountered an internal algorithm security error.  Please report this to the developers.\n"
					    + "CAUSE: Unknown\n"
					    + "MESSAGE: " + e.getMessage().toString() + "\n",
					    "An Error Occurred",
					    JOptionPane.ERROR_MESSAGE);
			}
		}
		try {
			hash = new String(encoded, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			if(e.getCause() != null){
				JOptionPane.showMessageDialog(frame,
					    "The application has encountered an encoding error.  Please report this to the developers.\n"
					    + "CAUSE: " + e.getCause().toString() + "\n"
					    + "MESSAGE: " + e.getMessage().toString() + "\n",
					    "An Error Occurred",
					    JOptionPane.ERROR_MESSAGE);
				}
				else {
					JOptionPane.showMessageDialog(frame,
						    "The application has encountered an encoding error.  Please report this to the developers.\n"
						    + "CAUSE: Unknown\n"
						    + "MESSAGE: " + e.getMessage().toString() + "\n",
						    "An Error Occurred",
						    JOptionPane.ERROR_MESSAGE);
				}
		}
		
		
		encoded = null;
		passbyte = null;
		md = null;
		
		return hash;
	}