[Botan-devel] DES and Tripple DES example needed

Brian Mitchell brian at bgmp.co.uk
Thu Mar 1 08:58:23 EST 2007


Hi,

        I'm trying to use Botan to do a very simple DES calculation. In 
reality it 
will need to be Tripple DES, but I can't even get a straight forward DES 
calculation working yet. Has anybody got a very simple, make a key, make a 
buffer and encrypt it program?

I have appended my simple program, but that always aborts when I construct 
DES.
If anyone has information on how to use Tripple DES that would be very nice.

Thanks

Brian.


#include <botan/des.h>

using namespace Botan;

int main()
{
        byte  inblock[80]      = {"11111111"};
        byte  outblock[80];
        byte  origblock[80];

        byte  key[80] = {"11111111"};

        DES des;
        u32bit kl = 8;  
        des.set_key(key,kl);
        des.encrypt(inblock, outblock);
        des.decrypt(outblock, origblock);

        return 1;
}



More information about the botan-devel mailing list