public static void main(String[] args) throws InterruptedException {
        if(!(args.length == 2 || (args.length == 3 && args[0].matches("-speedup|-scaleup")))) {
            System.out.println("Usage: java BruteForceDES [-scaleup|-speedup] t s");
            System.out.println(" t number of threads control");
            System.out.println(" s key size in bits");
            System.out.println(" -speedup measure speedup by running successively with 1..t threads");
            System.out.println(" -scaleup measure scaleup by running successively with 1..t threads");            
            System.out.println("          and key space s..t*s");            
            return;
        }

        // get the number of threads to use
        int numThreads = Integer.parseInt(args[args.length - 2]);
        
        // Get the argument
        int keybits = Integer.parseInt(args[args.length - 1]);

        if(args.length == 3 && args[0].equals("-speedup")) {
            for(int i = 1; i <= numThreads; i++) {
                breakDes(keybits, i, false);            
            }
        } else if (args.length == 3 && args[0].equals("-scaleup")) {            
            long baseRange = (0xFFFFFFFFFFFFFFFFL >>> (64 - keybits)) + 1;
            for(int i = 1; i <= numThreads; i++) {
                long maxkey = baseRange * i;
                // Accurate up to 52 bits of key
                long key = (long) (Math.random() * maxkey);
                breakDes(key, maxkey - 1, i, false);
            }            
        } else {
            breakDes(keybits, numThreads, true);
        }
    }