home *** CD-ROM | disk | FTP | other *** search
- ----CORTAR POR AQU═---------------
- #include <conio.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-
- /*************************/
-
- void main (void)
- {
- #define TAM_CADENA 15
-
- char password[TAM_CADENA+1],temporal[10],i;
- char p2_p3=0,p4,p5_p6=0,p8_p9;
- unsigned long p10_p14;
-
- clrscr();
-
- randomize();
- printf("%s","\n Generador de Llaves para el programa REVIVAL 2.1 . \n Por Estado+Porcino.");
-
- for(i=0;i<TAM_CADENA;++i)
- password[i]='0';
- password[i]='\0';
-
- password[0]='R';
- password[1]='V';
- password[7]='-';
-
- while (p2_p3<0x13)
- p2_p3=((random(9)+1)*10)+random(9)+1;
-
- while (p5_p6<0x25)
- p5_p6=((random(9)+1)*10)+random(9)+1;
-
- p10_p14=( ((random(9)+1)*10000)+ ((random(9)+1)*1000)+ ((random(9)+1)*100)+ ((random(9)+1)*10)+ random(9)+1);
-
- p4=((p2_p3-0x13)+(p10_p14^0x5468)+3)%0x0A;
- p8_p9=((p5_p6-0x25)+(p10_p14^0x5468)+3)%0x64;
-
- strncpy(&(password[2]),itoa(p2_p3,temporal,10),2);
- strncpy(&(password[4]),itoa(p4,temporal,10),1);
- strncpy(&(password[5]),itoa(p5_p6,temporal,10),2);
- strncpy(&(password[8]),itoa(p8_p9,temporal,10),2);
- strncpy(&(password[10]),ultoa(p10_p14,temporal,10),5);
-
- printf("\n\n Su password es: ");
- printf (password);
- }
- ----CORTAR POR AQU═---------------
-