fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <time.h>
  5.  
  6. #define KEY_SIZE 32
  7. #define BUFF_SIZE 1024
  8.  
  9. unsigned int holdrand = 1354316400;
  10.  
  11. static int Rand (void) {
  12. return(((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff);
  13. }
  14.  
  15.  
  16. char* genere_key(void) {
  17. int i;
  18. static char key[KEY_SIZE+1];
  19. const char charset[] =
  20. "abcdefghijklmnopqrstuvwxyz"
  21. "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  22. "123456789";
  23.  
  24. for(i = 0; i < KEY_SIZE; i++) {
  25. key[i] = charset[Rand() % (sizeof(charset) - 1)];
  26. }
  27. key[KEY_SIZE] = '\0';
  28.  
  29. return key;
  30. }
  31.  
  32. int main ()
  33. {
  34.  
  35. char *key;
  36. key = genere_key();
  37. printf("[+] Using key : %s\n", key);
  38.  
  39. }
  40.  
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
[+] Using key : BbC3rY1t2ircbLYcFaJUHdIxiC96njBF