Hi Ali,

Thus wrote Ali Sydney (asyd...@k-state.edu):

>    I am attempting to implement DES (in C++ with the OpenSSL
>    libraries) in ECB mode without padding.  I am using the following
>    function for encryption:

>  void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
>         DES_key_schedule *ks, int enc);

> However, this function does not have any parameters to specify the "no
> padding" option.  How do I configure "no padding"? Thank you.

you should use the EVP interface instead of the low-level functions

   ret = EVP_DecryptInit_ex(&ctx, EVP_des_ecb(), NULL, myKey, NULL);
   assert(ret == 1);

   ret = EVP_CIPHER_CTX_set_padding(&ctx, 0);
   assert(ret == 1);

and then EVP_Decrypt_Update(), EVP_DecryptFinal(). Similar for
encryption.

Hope this helps,

   Martin
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to