Hi knuth,
It's been a long time since I visited, but you might want to look at
the following (I don't recall what is in the sample project).
http://www.cryptopp.com/wiki/HexEncoder.
The short of it is that you should be able to perform the following:
CryptoPP::HexEncoder Encoder;
Encoder.Put( CipherText, CipherTextLength );
Encoder.MessageEnd();
For that matter, you should be able to use any Crpyto++ encoder:
CryptoPP::Base64Encoder Encoder;
or
CryptoPP::Base32Encoder Encoder;
Jeff
On 1/25/09, knuth <[email protected]> wrote:
>
>
> Hi Jeff.
> To explain the issue better ;i do something like this :
>
> string a = ReadFileContent("a.txt");
> string e = EncAES(a,"eeeeeeee",AES_MAX_BLOCK,iv);
> string encoded = HexEncode(e);
>
> Ok so ReadFileContent reads a plain file, EncAES encrypts it , AES ,
> everything correctly, a.txt having about 17000 chars and when doing
> HexEncoded the encoded string has only 200 chars!!!(if decoding and
> decrypting it only shows me(correctly) the 200 chars of plain text from
> those 17k)
>
> And another example that shows that buffered functions are the problem ->
> i'm trying to write an encrypted text into an archive using << , overloaded
> by a different lib, but still buffered writing. Again it only writes only a
> little part and not ALL the encrypted string.
>
> Cheers,
> knuth
>
>
>
> Jeffrey Walton-3 wrote:
> >
> >
> > Hi knuth,
> >
> >> I'm having some "problems" for quite some time now with Crypto++.
> >> There are two issues i want to raise
> > Have you examined any sample code from either the source files, the
> > Crypto++ FAQ, the Crypto++ wiki, or programming sites such as
> > CoedProject?
> >
> >> ifstream ifs(...);
> > In the Microsoft world, I usually observe problems with the wide stream
> > stuff.
> >
> >> ifs.read(buf,fileLength);
> > I suspect the issue is on the Write side of the equation.
> >
> >> The problem is that because the file contains weird characters after the
> >> encryption , it actually reads until it finds end of file (or 00 i think
> >> -
> >> in hex)
> > Nothing weird about them. They will be in the range from 0 - 255,
> > inclusive. End of File is usually defined similar to (unsigned
> > short)-1 or (unsigned int)-1 so that you can determine when a byte has
> > been read versus the end of file marker.
> >
> > Perhaps you should try a StringSink for the Write.
> >
> > Jeff
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Encryption-and-Encoding-conflict--tp21652293p21655404.html
> Sent from the Crypto++ Users mailing list archive at Nabble.com.
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---