public static String decrypt(String string, String algo) {

        if (!c.getID().equalsIgnoreCase(algo)) {
            updateC(algo);
        }

        try {
            c.setKey(key);
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, "This key is not valid.", "Invalid Key", JOptionPane.ERROR_MESSAGE);
        }

        return c.decrypt(string);
    }