Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 17:03

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help]Rijndael Aes encrypt file

Discussion on [Help]Rijndael Aes encrypt file within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
Naworia's Avatar
 
elite*gold: 12
Join Date: Aug 2011
Posts: 455
Received Thanks: 418
[Help]Rijndael Aes encrypt file

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;

Naworia is offline  
Old 06/25/2012, 09:59   #2
 
elite*gold: 5
Join Date: Sep 2006
Posts: 385
Received Thanks: 218
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.
Nightblizard is offline  
Old 06/25/2012, 12:29   #3
 
Naworia's Avatar
 
elite*gold: 12
Join Date: Aug 2011
Posts: 455
Received Thanks: 418
I added it and then it says another xxxx.h, how can i get that all Rijndael pack?
Naworia is offline  
Reply


Similar Threads Similar Threads
[QUESTION] encrypt file folder pack/Datei-Ordner verschlüsseln Pack
04/18/2012 - Metin2 Private Server - 0 Replies
Hallo an alle ... Inzwischen DaRealFreak danken Ihnen für Ihre Hilfe und für seine große Führer!!!! ( Extractor für jeden Client):handsdown: Dank der Anleitung konnte ich die wichtigsten lzo Dateien in dem Ordner mit den Extension Packs und xxxxxx.ext xxxxxxx.exs (anders als die üblichen EPK eix) extrahieren .... und ich es geschafft die Dateien zu entschlüsseln wollte ich ... Stunden, nachdem sie alles verändert und wie kann ich die Dateien neu zu erstellen ricriptare pc.ext und...
password encrypt
03/25/2011 - Metin2 Private Server - 6 Replies
hi does anyone have the original encrypted password for original rains files his login was 12345 i need the encrypted bit from navicat - please someone get me
Crash while Encrypt Aes
02/28/2011 - General Gaming Discussion - 3 Replies
Close
C++ RC5 Decrypt/Encrypt
02/10/2011 - CO2 Private Server - 2 Replies
Greetings guys, i was working on my own server and am coding it in c++, i heared i must decrypt the msg from the client so i can check if the user is exist or not (geting server name,account id and password) for patch 5290 or more so i was wondering if someone can help me and correct what am doing wrong here is my code hopefully someone can help me RC5.h #ifndef RC5_H #define RC5_H
hey can any one encrypt
10/20/2007 - Kal Online - 1 Replies
hey can any one encrypt this jobsystem-e



All times are GMT +1. The time now is 17:04.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.