When encrypting a file with a single line this code works fine, but
when I use a multi line file then I get a GPIF during the PumpAll()
routine.
string PrivateKeyFile = "key.pv";
string PublicKeyFile = "key.pb";
FileSource pubFile( PublicKeyFile.c_str(),true, new HexDecoder );
FileSource privFile( PrivateKeyFile.c_str(), true, new HexDecoder);
RSAES_OAEP_SHA_Encryptor Encryptor ( pubFile );
RSAES_OAEP_SHA_Decryptor Decryptor( privFile );
char strFilter[] = { "*.*||" };
CFileDialog FileDlg(TRUE, "*.*", NULL, 0, strFilter);
if( FileDlg.DoModal() == IDOK ){
char outputfilename[1024];
sprintf(outputfilename,"%s.encrypted",FileDlg.GetFileName());
int j,i;
char seed[32000];
for(i=0;i<32000;i++){
j = 1 + (int) (250.0 * rand() / (RAND_MAX + 1.0));
seed[i]=j;
}
RandomPool randPool;
randPool.Put((byte *)seed, strlen(seed));
FileSource f(FileDlg.GetFileName(), true, new
PK_EncryptorFilter(randPool, Encryptor, new
FileSink( outputfilename ) ));// works for one line files but not two
line files
} else {
return;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---