brute force/brute force/crack.cpp
//Loading data from a text file
//data[]: an array to read the data into
//length: length of data you want to read from the file 
//For simplicity, the ciphertext file contains ONLY 32 characters

Loading data from a text file
data[]: an array to read the data into
length: length of data you want to read from the file
For simplicity, the ciphertext file contains ONLY 32 characters
Loading data from a text file data [] : an array to read the data into length : length of data you want to read from the file For simplicity the ciphertext file contains ONLY 32 characters
void loadFile(unsigned char data[], int length)
{
 FILE* file = fopen("CipherFile1.txt", "r");
 if (file)
 {
  int i;
  for (i = 0; i < length; i++)
   data[i] = fgetc(file);
  fclose(file);
 }
 else
 {
  printf("Cannot open the file\n");
  exit(1);
 }
}
void loadFile ( unsigned char data [ ] , int length ) { FILE * file = fopen ( " " , " " ) ; if ( file ) { int i ; for ( i = 0 ; i < length ; i ++ ) data [ i ] = fgetc ( file ) ; fclose ( file ) ; } else { printf ( " \n " ) ; exit ( 1 ) ; } }
Loading data from a text file
data[]: an array to read the data into
length: length of data you want to read from the file
For simplicity, the ciphertext file contains ONLY 32 characters
Loading data from a text file data [] : an array to read the data into length : length of data you want to read from the file For simplicity the ciphertext file contains ONLY 32 characters