public static void search(Map<String, byte[]> array, Map<String, byte[]> table, byte[][] tw) throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidParameterSpecException, UnsupportedEncodingException{

        byte[] gamma = tw[0];
        byte[] neta = tw[1];
        
        String stgamma = Util.hexArray(gamma);
        
        byte[] tita = table.get(stgamma);
        
        byte[]value = new byte[tita.length];
        
        for(int i=0; i<neta.length; i++){
            value[i] = (byte) (neta[i] ^ tita[i]);
        }
        
        byte[] alfa = new byte[4];
        for(int i=0; i<4; i++){
            alfa[i] = value[i];
        }
        
        byte[] bkey = new byte[value.length-4];
        for(int i=4; i<value.length;i++){
            bkey[i-4] = value[i];
        }
        
        int size = bkey.length;
        Key key;
        
        byte[] id = new byte[16];
        byte [] a = {0, 0, 0, 0};
        
        ArrayList<String> list = new ArrayList<String>();
        
        while(!Arrays.equals(alfa, a)){  
            
            key = new SecretKeySpec(bkey, "AES");
            
                
            IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);
            
            Cipher c = Cipher.getInstance("AES/OFB/PKCS5Padding"); 
            c.init(Cipher.DECRYPT_MODE, key, ivParameterSpec);
            
            String salfa = Util.hexArray(alfa);
            byte[] enode = array.get(salfa);
            byte[] node = c.doFinal(enode);
            
            /*for(int i = node.length-4; i<node.length;i++){
                    int j=0;
                    alfa[j] = node[i];
                    j++;
            }*/   
            
            System.arraycopy(node, node.length-4, alfa, 0, 4);
            System.arraycopy(node, node.length-4-size, bkey, 0, size);
            System.arraycopy(node, 0, id, 0, node.length-size-4);
      
            String idS = new String (id, "UTF8");
            
            list.add(idS);
            
        }  
        
        //list.remove(list.size()-1);
        for(String w:list){
                System.out.println(w);
        }
        
         System.out.println("");
    }