Hello,
I've used the "How to use a block cipher in 5.0" in the FAQs and slightly
modified it to use it with DES. Does anyone know how I can modify it so it
uses 3DES (Triple DES)?
Any help would be great!
Here is my current code, I am using Crypto++ 5.1:

        const byte key2[] = {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40};//The same as
@@@@@@@@ converted to ascii value then to Hex
        const byte iv2[] = {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40
        byte plaintext[32];
        string MyText = "Chickens";
        for(int x = 0; x<8; x++)
        {
                plaintext[x] = MyText[x];
        }

        byte ciphertext2[32];
        CBC_Mode<DES>::Encryption encryption_DES_CBC;
        encryption_DES_CBC.SetKeyWithIV(key2, 8, iv2);//8x8bits = 64 bit key, 64bit
IV
        encryption_DES_CBC.ProcessString(ciphertext2, plaintext,8);
        string temp2;
        HexEncoder(new StringSink(temp2)).Put(ciphertext2,8);
        HexEncoder(new FileSink("DES.txt")).Put(ciphertext2,8);
        cout<<"C: "<<temp2<<endl<<endl;

Thanks,

New to Crypto++,
Edmund

Reply via email to