> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, September 16, 2003 3:22 PM
> To: [EMAIL PROTECTED]
> Subject: Triple Des (des-ede2 or des-ede3) How?
>
> It has been a long time since I programmed in C and this is 
> my first attempt at C++. I have a program that does 
> Encryption a Decryption but I need to use the Des-EDE2/3 
> algorithm. I've spent the better part of a week trying to 
> figure how to do this but I just realized that what I doing is wrong.
> 
> How do I convert the following to use the Des-ede2/3 algorithm
> 
> ...
> 
>

Hi Donald,

>From Wei's test harness. It may prove helpful.

Jeff


bool ValidateDES()
{
        cout << "\nDES validation suite running...\n\n";

        FileSource valdata("descert.dat", true, new HexDecoder);
        bool pass =
BlockTransformationTest(FixedRoundsCipherFactory<DESEncryption,
DESDecryption>(), valdata);

        cout << "\nTesting EDE2, EDE3, and XEX3 variants...\n\n";

        FileSource valdata1("3desval.dat", true, new HexDecoder);
        pass =
BlockTransformationTest(FixedRoundsCipherFactory<DES_EDE2_Encryption,
DES_EDE2_Decryption>(), valdata1, 1) && pass;
        pass =
BlockTransformationTest(FixedRoundsCipherFactory<DES_EDE3_Encryption,
DES_EDE3_Decryption>(), valdata1, 1) && pass;
        pass =
BlockTransformationTest(FixedRoundsCipherFactory<DES_XEX3_Encryption,
DES_XEX3_Decryption>(), valdata1, 1) && pass;

        return pass;
}

Reply via email to