public Strength checkPassword(final String password) {

		int combinations = 0;

		if (containsAny(password, DIGITS)) {
			combinations += 10;
		}

		if (containsAny(password, LOWERCASE)) {
			combinations += 26;
		}

		if (containsAny(password, UPPERCASE)) {
			combinations += 26;
		}

		if (containsAny(password, PUNCTUATION)) {
			combinations += PUNCTUATION.length();
		}

		// work out the total combinations
		int totalCombinations = (int) Math.pow(combinations, password.length());

		// if the password is a common password, then everything changes...
		if (isCommonPassword(password)) {
			return Strength.USELESS;
		}

		// work out how long it would take to crack this (@ 200 attempts per
		// second)
		int timeInSeconds = (totalCombinations / 200) / 2;

		// this is how many days? (there are 86,400 seconds in a day.
		int timeInDays = timeInSeconds / 86400;

		// how long we want it to last
		double lifetime = 365.23;

		// how close is the time to the projected time?
		double ratio = timeInDays / lifetime;

		if (ratio > 1) {
			return Strength.STRONG;
		}

		if (ratio > 0.10) {
			return Strength.WEAK;
		}

		if (ratio <= 0.10) {
			return Strength.USELESS;
		}

		return Strength.MEDIUM;
	}