Click here to Skip to main content
15,891,372 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow does RtlpNumberOf work? Pin
Glenn Sandoval6-Mar-08 12:29
Glenn Sandoval6-Mar-08 12:29 
GeneralRe: How does RtlpNumberOf work? Pin
Randor 6-Mar-08 12:48
professional Randor 6-Mar-08 12:48 
GeneralRe: How does RtlpNumberOf work? Pin
Mark Salsbery6-Mar-08 12:52
Mark Salsbery6-Mar-08 12:52 
GeneralRe: How does RtlpNumberOf work? Pin
Mark Salsbery6-Mar-08 13:14
Mark Salsbery6-Mar-08 13:14 
AnswerRe: How does RtlpNumberOf work? [modified] Pin
Rajkumar R7-Mar-08 3:24
Rajkumar R7-Mar-08 3:24 
GeneralRe: How does RtlpNumberOf work? Pin
Glenn Sandoval7-Mar-08 4:59
Glenn Sandoval7-Mar-08 4:59 
GeneralCustom action DLL for Windows Installer Pin
act_x6-Mar-08 11:15
act_x6-Mar-08 11:15 
GeneralCrypto++ & FileSink newbie question Pin
soul7106-Mar-08 11:14
soul7106-Mar-08 11:14 
Hello,

i'm trying to code a small encryption application, which encrypts files with different algorithms. i'm using crypto++ lib for the encryption part, and qt for the gui part. now after struggling with the encryption for a while, i found an example via google that i'm using now to encrypt files. its like this:

const char* CrypThread::EncryptAes(const char* inputFileName, const char* outputFileName, const char* password)<br />
{<br />
   byte pass[AES::BLOCKSIZE]; <br />
   byte iv[16]; <br />
   byte true_iv[16]; <br />
<br />
   AutoSeededRandomPool rng;<br />
<br />
   try <br />
   {  <br />
      StringSource(password, true, new HashFilter(*(new SHA256), new ArraySink(pass, AES::BLOCKSIZE)));<br />
<br />
      rng.GenerateBlock(iv, 16);<br />
      memset(true_iv, 0, 16);<br />
<br />
      AES::Encryption aesEncryption(pass, CryptoPP::AES::DEFAULT_KEYLENGTH);<br />
      CFB_Mode_ExternalCipher::Encryption cbcEncryption(aesEncryption, iv, 8);<br />
<br />
      StreamTransformationFilter *encryptor;<br />
<br />
      encryptor = new StreamTransformationFilter(cbcEncryption, new FileSink(outputFileName));<br />
      encryptor->Put(iv, 16);<br />
<br />
      FileSource(inputFileName, true, encryptor);<br />
   }<br />
   catch(CryptoPP::Exception &e)<br />
   {<br />
      return e.what();<br />
   }<br />
<br />
   return 0;<br />
}


While the encryption seems to work (i admit that i dont really know what i'm doing..), i was wondering if there is any way to monitor encryption progress. i want to implement a progress bar in the program, so you can see how far your 2gb file is encrypted already. my current idea is to watch the destination file with a QFileSystemWatcher, and set the current size of the destination file as progress. this would probably work, however the file size of the destination file stays 0 until the encryption is finished, even if the file is quite large.
is there any way to have crypto++ stream the encryption right to the hdd, so the file size grows?

if not, maybe someone has an idea of how to implement a progress-monitor function? in the application, the main thread runs the gui stuff, whereas the encryption is done in a separate thread.

also, since i'm still having issues with crypto++, anyone knows a site thats showing examples with file encryption?

tia for any help
GeneralActiveX question Pin
AbbyIndian6-Mar-08 7:15
AbbyIndian6-Mar-08 7:15 
GeneralRe: ActiveX question Pin
Ernest Laurentin6-Mar-08 7:18
Ernest Laurentin6-Mar-08 7:18 
QuestionHow to place an ActiveX control on a dialog box of a DLL Pin
Deelip6-Mar-08 6:32
Deelip6-Mar-08 6:32 
AnswerRe: How to place an ActiveX control on a dialog box of a DLL Pin
Ernest Laurentin6-Mar-08 7:16
Ernest Laurentin6-Mar-08 7:16 
GeneralRe: How to place an ActiveX control on a dialog box of a DLL Pin
Deelip6-Mar-08 18:19
Deelip6-Mar-08 18:19 
GeneralDLL persistent storage "new" operator Pin
ForNow6-Mar-08 6:23
ForNow6-Mar-08 6:23 
QuestionRe: DLL persistent storage "new" operator Pin
CPallini6-Mar-08 21:32
mveCPallini6-Mar-08 21:32 
GeneralRe: DLL persistent storage "new" operator Pin
ForNow6-Mar-08 23:03
ForNow6-Mar-08 23:03 
GeneralRe: DLL persistent storage "new" operator Pin
CPallini6-Mar-08 23:11
mveCPallini6-Mar-08 23:11 
GeneralRe: DLL persistent storage "new" operator Pin
ForNow7-Mar-08 6:22
ForNow7-Mar-08 6:22 
GeneralObjects outside/free of the form Pin
codeinelogic6-Mar-08 5:43
codeinelogic6-Mar-08 5:43 
GeneralRe: Objects outside/free of the form Pin
led mike6-Mar-08 5:52
led mike6-Mar-08 5:52 
GeneralRe: Objects outside/free of the form Pin
CPallini6-Mar-08 5:52
mveCPallini6-Mar-08 5:52 
QuestionHow do I prevent multiple instances of my program Pin
cgb1436-Mar-08 5:28
cgb1436-Mar-08 5:28 
AnswerRe: How do I prevent multiple instances of my program Pin
Michael Schubert6-Mar-08 5:37
Michael Schubert6-Mar-08 5:37 
GeneralRe: How do I prevent multiple instances of my program Pin
cgb1436-Mar-08 5:59
cgb1436-Mar-08 5:59 
GeneralRe: How do I prevent multiple instances of my program Pin
Michael Schubert6-Mar-08 6:26
Michael Schubert6-Mar-08 6:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.