public static void main(String[] args) {
        try {
            String key=args[3];
            seed=1;
            for(int i=0;i<key.length();i++,seed*=10)
                seed*=key.charAt(i);
            rotors=Integer.parseInt(args[2]);
            offsets=new int[args.length-4];
            for(int i=4;i<args.length;i++)
                offsets[i-4]=Integer.parseInt(args[i]);
            Client c=new Client(args[0], Integer.parseInt(args[1]));
            BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
            while(running){
                String cmd=in.readLine();
                if(cmd.equals("message")){
                    String msg=in.readLine();
                    e=new Enigma(rotors, seed,offsets);
                    c.send(new Message("message", c.socket.getLocalAddress(), c.socket.getInetAddress(), e.cypher(msg.getBytes())));
                }else if(cmd.equals("quit")){
                    running=false;
                }else if(cmd.equals("server quit")){
                    c.send(new Message("quit", c.socket.getLocalAddress(), c.socket.getInetAddress(), null));
                    running=false;
                }if(cmd.equals("file")){
                    String msg=in.readLine();
                    File file=new File(msg);
                    InputStream fin=new FileInputStream(file);
                    byte buffer[]=new byte[(int)file.length()];
                    fin.read(buffer);
                    fin.close();
                    e=new Enigma(rotors, seed,offsets);
                    c.send(new Message("file", c.socket.getLocalAddress(), c.socket.getInetAddress(), e.cypher(buffer)));
                }
            }
        } catch (IOException ex) {
            Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
        }
    }