Before using CryptoPP I had not used std::string either, but a) there are good
examples in the sample code; and...using std::string is like using
{
    char * pstring = new char[size];
    memcpy( pstring, source, size);
    // use buffer

    if (pstring) {
        delete pstring;
    }
}
with out all the extra work, plus it gives a little extra.  If you are
familiar with any other stiring class std::string will be similar.

The things that took me a while to figure out were
.c_str()  // for c-style strings
and
.begin() // for a pointer to the first char in the string

unfortunatly with C7 begin() in now "const def() const", so using it for a
manipulatible pointer is not usful unless you cast away const'ness.



On Mon, 9 Jun 2003 07:45:25 +0800, you wrote:

 Hi, everyone. How can I use a block cipher, such as Blowfish in ECB mode,
just like a stream cipher, i.e. I don't have to make sure that the size of the
buffer to be encrypted is in multiples of the block size. In FAQ, there is a
solution using StreamTransformationFilter, StringSink and std::string. The
problem is that I haven't used STL before so I wonder if there is an
alternative way that can obtain the same goal. Thanks.
 

========
[Mark]

Reply via email to