public static String IdentityMac() //Returns the Mac address to be used as Identity
	{
		File path = new File(MainStart.rootpath);
		path.mkdirs();
		File authfile = new File(path,"auth.bin");
		String mac=null;
		try{
			if (authfile.exists())
			{
				byte buffer[]= new byte[12];
				FileInputStream fis = new FileInputStream(authfile);
				while(fis.read(buffer)!=-1)
					mac=new String(buffer);
				fis.close();
				return mac;
			}
			else
			{
				
					Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
					while(e.hasMoreElements())
				    {
			            NetworkInterface n=(NetworkInterface) e.nextElement();
			            if (!n.isLoopback() && n.isUp())
			            {
			            	mac = new String(IpAddress.findmac(n));
			            	FileOutputStream fos = new FileOutputStream(authfile);
			    			fos.write(mac.getBytes());
			    			fos.close();
			            	return mac;
			            }       		
				    }
				}
			}
			catch(FileNotFoundException fnfe)
			{
				System.err.println("File not Found");
			}
			catch(SecurityException noperm)
			{
				System.err.println("No permission to read/write to file");
			}
			catch (SocketException soc)
			{
				JOptionPane.showMessageDialog(null,"You're not connected to any network","The Three Musketeers say",JOptionPane.ERROR_MESSAGE);
			}
			catch(IOException ioe)
			{
				System.err.println("Some input/output error occured");
			}
		return mac;
	}