now I am wondering how I can make a random salt that is 9 characters long but the first 3 are "$1$" because that initiates the md5 encryption algorithm.Code:/* * Encrypt * encrypt.c * compile on linux; use: * gcc -o encrypt -lcrypt encrypt.c * (C) Lucas Campbell 2001-2002 */ #include <stdio.h> int main(int argc, char* argv[]) { if(argv[1] != NULL) { printf("%s is encrypted using md5 as:\n",argv[1]); printf("%s\n",crypt(argv[1],"$1$kL10as"); } else { ptintf("Need to add the string to be encrypted\n"); printf("Example: encrypt [text here]\n"); } return 0; } // See top for details
Any help will be appreciated
The encryption program is mine and feel free to use it and distribute it as long as it contains the above information about compilation, copyright and the author.