CBC mode requires an IV. You should be getting a C++ exception because 
you're not supplying the IV, and it probably causes program termination 
because you're not catching it.

On Fri, Oct 17, 2003 at 10:57:52AM +0200, Vincent Richomme @Tricubes wrote:
> I am trying to use the CBC_mode but I always have this error :
> 
> RunTime Error : abnormal program termination
> 
> Here is the code i am using :
> 
>         byte key[DES::DEFAULT_KEYLENGTH];
>         memcpy(key, "12345678", sizeof(key));
>         CBC_Mode<DES>::Encryption ecbEncryption;
>         ecbEncryption.SetKey(key, ecbEncryption.DefaultKeyLength());
> 
> I don't understand because when I use the ECB_mode it works :
> 
> // 3DES in Electronic CodeBook mode(ECB) with Key (m_Key) and RN (m_RN)
>  unsigned int outputLength;
>  ECB_Mode<DES_EDE2>::Encryption ecbEncryptionL;
>  ecbEncryptionL.SetKey(m_Key, ecbEncryptionL.DefaultKeyLength() );
>  StreamTransformationFilter encryptorL(ecbEncryptionL, NULL, 
> StreamTransformationFilter::ZEROS_PADDING);
>  encryptorL.Put(m_nRN, 8);
>  encryptorL.MessageEnd();
>  outputLength = encryptorL.MaxRetrievable();
>  encryptorL.Get(m_KatsL, outputLength);
> 
> 
> My system is : W2k SP4, Visual Studio 6 SP 5, processor pack, cryptolib 5.1

Reply via email to