lepricaun Posted August 10, 2004 Report Share Posted August 10, 2004 just like the title said,i've written a password generator in C, which has no output but the password if used correctly, is opensource via the GPL license, works for both windows as linux.the attachment includes the source + license.to compile it under windows, get a copy of DEV-C++ here.to compile it under linux (presuming your distro already includes gcc):"gcc -o pwgenCL pwgenCL.c" (without the " quotes).i hope this program is usefull to anyone and i am open to response/comments.contact me at : scorpius_unknown at yahoo dot comgreetsScorpiuspwgenCL.zip Quote Link to comment Share on other sites More sharing options...
andsome Posted August 11, 2004 Report Share Posted August 11, 2004 I don't understand what you are saying, but WELCOME to WF. Quote Link to comment Share on other sites More sharing options...
lepricaun Posted August 11, 2004 Author Report Share Posted August 11, 2004 thanks, i've written a password generator, which i would like to be usefull to people, that's why i've posted it :)BUT, i've already rewritten the program to be more efficient and have an extra parameter to create even more randomness.here's the source:pwgenCL_2/*pwgenCL version 2 (pwgenCL_2)Copyright (C) 2004 Scorpius, password generator, written as a command line scripting utility.this program is freesource, which means you may use and/or modify it under the GPL license.if you'd like to contact me with comments/bugs/suggestions or just to say hello,my email address is: [email protected].  i hope you enjoy using my program and that you find it usefull :)      to compile it under windows, get a copy of Dev-C++ (it's free), or another C/C++ compiler.to compile it under linux, just type "gcc -o pwgenCL_2 pwgenCL_2.c" (without the " quotes)*/#include <stdio.h>#include <stdlib.h>#include <time.h>#include <strings.h>char *generated_password(char*, int,int);int main(int argc, char** argv){  /*the character sets*/   char *very_easy_set = "abcdefghijklmnopqrstuvwxyz";   char *very_easy2_set = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";   char *easy_set = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";   char *medium_set = "abcdefghijklmnopqrstuvwxyz0123456789";   char *hard_set = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";   char *hard2_set = "\\][^_abcdefghijklmnopqrstuvwxyz0123456789";   char *very_hard_set = "!\"#$%'(*)+,-./abcdefghijklmnopqrstuvwxyz0123456789";   char *extreme_set = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";     int characterset=0;   int password_length=0;   int user_supplied=0;   if(argc!=4)   {   printf("\npwgenCL_2,commandline password generator, Copyright (C) 2004 Scorpius");   printf("\n\npwgenCL_2 is free software; you can redistribute it and/or modify");   printf("\nit under the terms of the GNU General Public License as published by");   printf("\nthe Free Software Foundation; either version 2 of the License.");   printf("\n\npwgenCL_2 is distributed in the hope that it will be useful,");   printf("\nbut WITHOUT ANY WARRANTY; without even the implied warranty of");   printf("\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the");   printf("\nGNU General Public License for more details.");   printf("\n\nYou should have received a copy of the GNU General Public License");   printf("\nalong with this program; if not, write to the Free Software");   printf("\nFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n");   printf("\n\t  ***Contact Scorpius: [email protected]***");   printf("\n\nCharacter sets:");   printf("\n1: (a-z)\t\t\t\t\tvery easy password");     printf("\n2: (A-Z)\t\t\t\t\tvery easy password");     printf("\n3: (a-z,A-Z)\t\t\t\t\teasy password");     printf("\n4: (a-z,0-9)\t\t\t\t\tmedium password");     printf("\n5: (A-Z,a-z,0-9)\t\t\t\thard password");     printf("\n6: (a-z,0-9, \\ ] [ ^ _ )\t\t\thard password");     printf("\n7: ( ! \" # $ % ' ( * ) + , - . /  ,a-z,0-9)\tvery hard password");     printf("\n8: full keyboard characters (except space), almost impossible to crack\n\n");     printf("The maximum password length is 256 characters\n");     printf("Usage: %s <characterset> <password length> <user supplied number>\n",argv[0]);     printf("\n*The <user supplied number> is inserted to create extra randomness*\n");     printf("\nExample: %s 8 15 5454303\n",argv[0]);     return 0;   }   if(argc==4)/*if all parameters, (characterset,passwordlength,randomization number) run the program*/   {   characterset=atoi(argv[1]);/*create integer from the argument*/   password_length=atoi(argv[2]);/*create integer from the argument*/   user_supplied=atoi(argv[3]);/*create integer from the argument*/   if (password_length<1)     {  printf("Password length: %d is too small.\n",password_length);  return -1;  }  if (password_length>256)  {  printf("Password length: %d is too large.\n",password_length);  return -1;  }   switch(characterset)   {         case 1:             generated_password(very_easy_set,password_length,user_supplied);             break;         case 2:             generated_password(very_easy2_set,password_length,user_supplied);             break;         case 3:             generated_password(easy_set,password_length,user_supplied);             break;         case 4:             generated_password(medium_set,password_length,user_supplied);             break;         case 5:             generated_password(hard_set,password_length,user_supplied);             break;         case 6:             generated_password(hard2_set,password_length,user_supplied);             break;         case 7:             generated_password(very_hard_set,password_length,user_supplied);             break;         case 8:             generated_password(extreme_set,password_length,user_supplied);             break;        default:             printf("Invalid character set\n");        return -1;             break;   }   return 0;   }    else return -1;  }/*the password generator function*/char *generated_password(char* char_set, int length,int user_number){         srand(user_number*time(NULL));     int loop;     int set_length=strlen(char_set);       for(loop=0;loop<length;loop++)     {       putchar(char_set[rand()%set_length]);     }     printf("\n");} Quote Link to comment Share on other sites More sharing options...
Scarecrow Man Posted August 11, 2004 Report Share Posted August 11, 2004 I don't understand what you are saying, but WELCOME to WF.It generates passwords for you. If you needed a good secure password, you'd use one of these types of tools, but have to remember it also! :D Quote Link to comment Share on other sites More sharing options...
nellie2 Posted August 11, 2004 Report Share Posted August 11, 2004 Well all I can say is thank you very much for sharing that with us. :) Quote Link to comment Share on other sites More sharing options...
lepricaun Posted August 12, 2004 Author Report Share Posted August 12, 2004 your welcome! and yes, that's the downsite, you need to be able to remember the password, although it can be used as a tool to generate passwords if a new useraccount is created, like when someone creates an account to a forum, or on a Domain. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.