It's ok to put binary data into a std::string. Or pass NULL into
HexDecoder (where "new StringSink" is) and it'll default to MessageQueue,
which will store the data in a buffer for you to get with a Get() call.

On Thu, May 08, 2003 at 01:23:21PM -0400, chris holt wrote:
> I am relatively new to using the library and have a sort of fundamental
> question.
> If I am decrypting binary data, what Sink class do I use to store the data
> into a variable when I don't yet know the size of the decrypted data.
> I know this probably a rudimentary question but I've been poking around and
> nothing glaring comes out at me.
>  
> For instance, to decrpyt a string using DES encryption you would use the
> following code:
>  
> string strText;
>  
> // ---- Decrypt string ---- //
> HexDecoder decryptor(new DefaultDecryptorWithMAC(m_strDESPassword.c_str(),
> new StringSink(strText)));
> decryptor.Put((byte *)pszCipher, strlen(pszCipher));
> decryptor.MessageEnd();
>  
>  
> What do you pass in for the BufferedtTransformation when decrypting binary
> data?
>  
>  
> Thanks,
>  
> Chris
>  

Reply via email to