private boolean checkOldPasswd(User user, String oldPasswd)
			throws NoSuchAlgorithmException {

		boolean passwdMatched = false;
		BigInteger encryptedPasswd = null;
		encryptedPasswd = encryptPassword(oldPasswd);
		user.setPassword(encryptedPasswd);
		User foundUser = dao.findEntity(user, user.getRole());

		if (foundUser != null) {

			if (foundUser.getPassword().equals(user.getPassword())) {
				passwdMatched = true;
			}
		} else {
			LOGGER.error("User '" + user.getRole()
					+ "' does not exist in the database");
		}

		return passwdMatched;
	}