@Override
    public boolean checkPassword(String p1, String p2) {
        String hashedPublic = "";
        try {
            hashedPublic = encode(p2);
        } catch (NoSuchAlgorithmException ex) {
            Logger.getLogger(MRSBean.class.getName()).log(Level.SEVERE, null, ex);
        }
        if (hashedPublic.equals(p1)) {
            return true;
        }
        return false;
    }