mmmm

by santoprova3 on July 24th, 2010
No notes
Syntax: C
Show lines - Hide lines - Show in textbox - Download
char *initVect;
 
char myPassword[]="cazzodibuddhaone";
 
Questo sta nel main ....
 
   skey=(char *)malloc(strlen(myPassword)+10+1);
      for (x=0;x<strlen(myPassword);x++)
      {
          skey[x]=myPassword[x];
      }
      for (x=strlen(myPassword);x<strlen(myPassword)+10;x++)
      {
          skey[x]=initVect[x-strlen(myPassword)];
      }
      skey[strlen(myPassword)+10]=(char)0;
 
 
 
    printf("\n segnala1 \n");
 
     for (x=0;x<strlen(myPassword)+10;x++){
        printf("%c",skey[x]);
    }
 
output: 
cazzodibuddhaone╔╩╦╠═╬¤ðÐÊ <-- questi sono 10 char con asc 201,202,203 .... etc etc
 
 
printf("\n");
for (x=0;x<strlen(myPassword)+10;x++){
        printf("%i",(unsigned int)skey[x]);
    }
output:
99971221221111001059811710010010497111110101-55-54-53-52-51-50-49-48-47-46
(perchè ho i negativi ???????)
 
 
 
printf("\n");
 
 
 
 
======= fine main
 
Questa genera i 10 char 201,202,203 .....
int generaInitVect(){
 
    int x;
    int ran;
    int max=255;
    int min=0;
    srand(time(NULL));
 
    for (x=0;x<10;x++){
        //ran= (255*rand()/(RAND_MAX+1.0));
        ran=min + ( (max-min+1) * rand() / (RAND_MAX+1.0) );
 
        printf("ran estratto = %i-%c ****\n",ran,(char)ran);
        //initVect[x]= (char)ran ;
        initVect[x]= x+201 ;
    }
 
        initVect[10]= (char)0 ;
    return 0;
 
}
 

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS