--- ircd.c.old	2007-05-20 09:15:52.000000000 +0000
+++ ircd.c	2007-06-11 20:14:00.000000000 +0000
@@ -1245,6 +1245,49 @@
 			  printf("Encrypted password is: %s\n", result);
 			  exit(0);
 		  }
+#else /* _WIN32 */
+		  case 'P':{
+			  short type;
+			  char *result;
+			  srand(TStime());
+			  if ((type = Auth_FindType(p)) == -1) {
+				  MessageBox(NULL, p, "No such auth type", MB_ICONERROR | MB_OK);
+				  return 0;
+			  }
+			  p = *++argv;
+			  argc--;
+#ifdef AUTHENABLE_UNIXCRYPT
+			  if ((type == AUTHTYPE_UNIXCRYPT) && (strlen(p) > 8))
+			  {
+			      MessageBox(NULL, "Password truncated to 8 characters due to 'crypt' algorithm. "
+		                 "You are suggested to use the 'md5' algorithm instead.", "WARNING", MB_ICONWARNING | MB_OK);
+				  p[8] = '\0';
+			  }
+#endif
+			  if (!(result = Auth_Make(type, p))) {
+				  MessageBox(NULL, "Authentication failed\n", "ERROR", MB_ICONERROR | MB_OK);
+				  return 0;
+			  }
+			  /*MessageBox(NULL, result, "Encrypted password", MB_ICONINFORMATION | MB_OK);*/
+			  if (OpenClipboard(NULL))
+			  {
+			      LPTSTR lptstrCopy; 
+			      HGLOBAL hglbCopy;
+			      hglbCopy = GlobalAlloc(GMEM_MOVEABLE, lstrlen(result) + 1);
+			      if(hglbCopy != NULL)
+			      {
+			          lptstrCopy = GlobalLock(hglbCopy); 
+			          lstrcpy(lptstrCopy, result);
+			          GlobalUnlock(hglbCopy);
+			          EmptyClipboard();
+			          SetClipboardData(CF_TEXT, hglbCopy); 
+			          MessageBox(NULL, "Encrypted password copied to the clipboard",
+					"Encrypted password", MB_ICONINFORMATION | MB_OK);
+			      }
+			      CloseClipboard();
+			  }
+			  exit 0;
+		  }
 #endif
 
 		  case 'p':
