*** crackcheck.c-org	2005-02-25 18:59:51.000000000 +0100
--- crackcheck.c-new	2005-10-28 19:13:04.000000000 +0200
***************
*** 19,24 ****
--- 19,45 ----
  	exit(-1);
  }
  
+ void complexity(char* passwd)
+ {
+   // TG 26.10.2005 
+   // check password for complexity like MS Windows NT 
+   
+   int c_upper, c_lower, c_digit, c_punct, i;
+   c_upper = c_lower = c_digit = c_punct = 0;
+   for (i=0;i<strlen(passwd);i++)
+     {
+       if (isupper(passwd[i])) c_upper = 1;
+       else if (islower(passwd[i])) c_lower = 1;
+       else if (isdigit(passwd[i])) c_digit = 1;
+       else if (ispunct(passwd[i])) c_punct = 1;
+     }
+   if ((c_upper + c_lower + c_digit + c_punct) < 3 )
+     {
+       printf("%s", "\nERROR - Password way to simple\n\n");
+       exit(-4);
+     }
+ }
+ 
  int main(int argc, char **argv) {
  	extern char *optarg;
  	int c;
***************
*** 43,48 ****
--- 64,70 ----
  		usage(argv[0]);
  	} 
  
+ 	fflush(stdin);
  	password = fgets(f, sizeof(f), stdin);
  
  	if (password == NULL) {
***************
*** 50,55 ****
--- 72,79 ----
  		exit(-2);
  	}
  
+ 	complexity(&password);
+ 
  	reply = FascistCheck(password, dictionary);
  	if (reply != NULL) {
  		fprintf(stderr, "ERR - %s\n\n", reply);
