title: PK_DECRYPTORFILTER is returning empty string?
body: <p>I am using crypto++/cryptopp to encrypt and decrypt a file.
  There are two function int the program 1.Encrypt 2.Decrypt</p>
  <p>The following is the ENCRYPT() fn:</p>
  <pre><code>ECIES&lt;ECP&gt;::Decryptor d0(prng, ASN1::secp256r1());
  PrintPrivateKey(d0.GetKey());
  
  ECIES&lt;ECP&gt;::Encryptor e0(d0);
  PrintPublicKey(e0.GetKey());
  SavePrivateKey(d0.GetPrivateKey());
  SavePublicKey(e0.GetPublicKey());
  
  ifstream infile;
  ofstream outfile;
  string sen,sen1,line,enc;
  sen.clear();
  line.clear();
  enc.clear();
  infile.open(&quot;Me/text.txt&quot;);
  if(infile.is_open()){
      while(!infile.eof()){
          getline(infile,line);
          sen1 = sen1 + line;                                
      }
  }
  StringSource ss1(sen,true,new PK_EncryptorFilter(prng,e0,new StringSink(enc)));
  cout&lt;&lt;&quot;Encrypted:&quot;&lt;&lt;endl&lt;&lt;enc&lt;&lt;endl;
  infile.close();    
  string encoded;
  StringSource ss3(enc, true, new HexEncoder(new StringSink(encoded)));
  outfile.open(&quot;Me/e1nc_text.txt&quot;);
  outfile&lt;&lt;encoded;
  outfile.close();
  cout&lt;&lt;&quot;Encoded: &quot;&lt;&lt; encoded&lt;&lt;endl;
  </code></pre>
  <p>AND this here is DECRYPT():</p>
  <pre><code>ECIES&lt;ECP&gt;::Decryptor d1;
  //ECIES&lt;ECP&gt;::Decryptor d0(prng, ASN1::secp256r1());
  LoadPrivateKey(d1.AccessPrivateKey());
  d1.GetPrivateKey().ThrowIfInvalid(prng, 3);
  
  ECIES&lt;ECP&gt;::Encryptor e1;
  LoadPublicKey(e1.AccessPublicKey());
  e1.GetPublicKey(). ThrowIfInvalid(prng, 3);
  
  PrintPrivateKey(d1.GetKey());
   PrintPublicKey(e1.GetKey());
     
  ifstream file;
  string sen,line,dec,decoded;
  sen.clear();
  line.clear();
  file.open(&quot;Me/e1nc_text.txt&quot;);
  if(file.is_open()){
      while(!file.eof()){
          getline(file,line);
          sen = sen + line;                                
      }
  }
  StringSource ss7 (sen,true, new HexDecoder(new StringSink(decoded)));
  cout&lt;&lt;&quot;Decoded&quot;&lt;&lt;endl&lt;&lt;decoded;
  StringSource ss8 (decoded,true,new PK_DecryptorFilter(prng,d1,new StringSink(dec)));
  cout&lt;&lt;endl&lt;&lt;&quot;Decrypted:&quot;&lt;&lt;endl;
  cout&lt;&lt;dec;
  ofstream outfile(&quot;Me/decrypt.txt&quot;);
  outfile&lt;&lt;dec;
  </code></pre>
  <p>THIS IS THE OUTPUT FOR THE PROGRAM
  <a href="https://i.stack.imgur.com/XaJtw.png" rel="nofollow noreferrer">OutPut</a></p>
  <p>If we take a look in that the encrypted text is the same as the decoded text that means the cipher text is the same and its not invalid text also a check is there to ensure that the keys loaded are the same so that also is not the problem.Encoded,Decoded,Encrypted all give output except the Decrypted.</p>
  <p>Do anyone have any ideas what I am doing wrong?
  If anyone does and they cant reply here cuz of reputation points please mail it to vparashar0299@gmail.com</p>