I generally use something like this: <code> string plaintext = "this is some plaintext"; string key = "this is some kind of secret key"; string ciphertext; GOSTEncryption myGOST((const byte*) key.data(), key.length()); ECB_Mode_ExternalCipher ecb(myGOST); StringSource(plaintext, true, new StreamTransformationFilter(ecb, new StringSink(ciphertext))); </code>
Some the encrypted result should now be in ciphertext. This is assuming that the thing doesn't cause an exception because of the keylength, which I haven't actually checked, so be sure to try and catch those exceptions. As for the meanings of ECB, CBC, etc., there is some documentation on all of those at the Crypto++ web site. Bruce Schneier's 'Applied Cryptography' would be useful, too, I'm sure. J On November 1, 2002 05:19 pm, Yurong Lin wrote: > Thanks for the message, however I still find it difficult to comprehend. > Crypto++ is a wonderful product, to be speaking in honesty. But its lack of > documentation and samples presents a sharp learning curve for anyone who > wants to use it. I have actually been using GOST block cipher in a couple > of project, the code was written by myself in C++. I am now working in a > new project that requires using a public key encryption as well as a GOST, > so I thought I would use Crypto++ instead of writing my own code from > ground up. > > > > Could anyone who has used a block cipher such as GOST or similar in > Crypto++ care sharing your code? Or could anyone please explain the > meanings of these cipher modes such as ECB, CBC, CFB, OFB, or CTR. Which > mode should I be using, and how can I use a block cipher in an easy and > simple way. All I want to achieve is to use GOST to encrypt and decrypt a > piece of text. > > > > Thanks! > > > > Yurong Lin > >
