Well, Crypto++ has a fairly easy to use DES EDE transform. I'm not sure what else you are looking for. With the sample code someone already gave you, and the Doxygen reference manual you should have everything you need to start implementing an X9.24 routine. Maybe splitting the key takes a little bit of work, but it shouldn't be difficult.

Maybe I missed an earlier message of yours. What part are you having problems with?

        73,
                Shawn


Tim Droz wrote:


yeah you may be correct that DUKPT is not well defined
. I'm refering to standard ANSI X9.24-2002 (PART 1)
which very well defines the DUKPT
implementation(TDES).


My Question was why would using this library becomes
so hard  for a well defined algorithm such as ANSI
X9.24? or as you say perhaps all the required base
routines may be there I just couldn't figure that out
yet...

I'm somewhat successful using some public domain DES
code for my purpose , I just could resisit  the fact
this crypto library is great but unfrotunattely so
hard use due to hardly any documentation for a quick
reference. It would really great someone with
experince to point to  the correct path to go.

If I ever get sucessful I'm sure I will share my
experince with crypto users.


Thanks for your help. Tim




--- Shawn Masters <[EMAIL PROTECTED]> wrote:


DUKPT isn't exactly a well defined acronym. You
could be using any of a wide host of algorithms. Do you mean ANSI X9.24? If so I think all of the base routines are there. You will have to
plug them together to get X9.24 behavior.


        73,
                Shawn

Tim Droz wrote:


Yeah this sample is great,for a newby this kind of
sample / documentation would be nice.

I'm trying to do DUKPT simulation with crypto++

I'm


not sure of this library and its applicability.
Any more help would be really appreciated.


Thanks again David Tim

--- "David C. Partridge"

<[EMAIL PROTECTED]>


wrote:


Do you mean like:
#include "default.h"
#include "des.h"

#include <iostream>
#include <time.h>

#include <windows.h>

#if (_MSC_VER >= 1000)
#include <crtdbg.h>               // for the debug heap
#endif

USING_NAMESPACE(CryptoPP)
USING_NAMESPACE(std)


int main() { // Note the for ECB, the PlainText and Cipher Text MUST be an EXACT multiple // of the cipher blocksize byte plaintext[48] =

{'H','e','l','l','o','


','W','o','r','l','d','\0'};
      byte * ciphertext;
      byte * result;
      byte key[DES::DEFAULT_KEYLENGTH];

      // initialize key and iv here
      memcpy(key, "12345678", sizeof(key));


// encrypt ECB_Mode<DES>::Encryption ecbEncryption; ecbEncryption.SetKey(key, ecbEncryption.DefaultKeyLength()); StreamTransformationFilter encryptor(ecbEncryption, NULL, NULL); encryptor.Put(plaintext,

sizeof(plaintext));


encryptor.MessageEnd();

      unsigned int outputLength =
encryptor.MaxRetrievable();
      ciphertext = new byte[outputLength];
      encryptor.Get(ciphertext, outputLength);

      // now decrypt
      ECB_Mode<DES>::Decryption ecbDecryption;
      ecbDecryption.SetKey(key,
ecbDecryption.DefaultKeyLength());
      StreamTransformationFilter
decryptor(ecbDecryption, NULL, NULL);
      decryptor.Put(ciphertext, outputLength);
      decryptor.MessageEnd();

      outputLength = decryptor.MaxRetrievable();
      result = new byte[outputLength];
      decryptor.Get(result, outputLength);

cout << "recovered plaintext is " <<

result


<< endl;

      delete [] ciphertext;
      delete [] result;
      return 0;
}





__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site

design software


http://sitebuilder.yahoo.com





__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com





Reply via email to