[Help]Rijndael Aes encrypt file

06/25/2012 02:48 Naworia#1
Hello I'm new in c++ and i had a script that encoding setting files. It says error about Rijndael.h because i have not it yet. But i know it gives error again when i have it. Can you explain me for step by step that what must i do generally for complete this script?

Code :
PHP Code:
#include "stdafx.h"
#include "Rijndael.h"
#include <fstream>
#include <iostream>
using namespace std;


int _tmain(int argc_TCHARargv[])
{
    
CRijndael Rij;
    
char DecryptStr[16] = {0};
    
char DecryptedStr[20] = {0};
    
char filestr[999999] = {0};
    
Rij.MakeKey("zontim",CRijndael::sm_chain016,16);

    
FILE *filein;
    
filein fopen(argv[1],"rb");
    
fseek(filein,0,SEEK_END);
    
int size ftell(filein);
    
rewind (filein);
    
fseek(filein,0,SEEK_SET);
    
char *bufin = (char*)malloc(sizeof(char)*size+1);
    
memset(bufin,0,sizeof(char)*size);
    
fread(bufin,1,size,filein);

    
FILE *fileout;
    
char outputname[999] = {0};
    
sprintf(outputname,"%s.set",argv[1]);
    
fileout fopen(outputname,"a+");

    
//für ft
    
    
char bla[9999999] = {0};
      for(
int i 0;< (size);i+=16)
      {
          
Rij.Encrypt(bufin+ifilestr,16);
          
strcat(bla,filestr);
     }
    for(
int i 0;< (size);i++)
    {
        
bla[i+1] = bla[i];
    }
     
bla[0] = 0x0b;
     
fwrite(bla,1,(size+1),fileout);
    
fclose(filein);
    
fclose(fileout);
    
free(bufin);
    
cout << "fertig";
    
cin.get();
    return 
0;

06/25/2012 09:59 Nightblizard#2
Hey,
first of all this is very very bad C++. I don't know where you got that from, but this is garbage.
About your problem: Well, you might want to tell us want error you exactly get. If it says Rijndael.h does not exist, then you might want to add it to your project.
06/25/2012 12:29 Naworia#3
I added it and then it says another xxxx.h, how can i get that all Rijndael pack?