Hi,

I am trying to do a simple ecryption/decryption of a file, alas i got stuck
at the very first function i used (EVP_BytesToKey()), visual c started
screaming blue murder at me.  I basically took the code from the
EVP_EncryptInit.pod file and compiled it in a visual c console app, but it
never worked so i messed around a bit and came up with the code that
follows, it compiles without error, BUT, is it the right way of doing
things?  I would appreciate your help.

Thanks in advance

Lee Melville.

// -------------------------------------------------------------------------
---------------------

OpenSSL_add_all_algorithms();

char key[EVP_MAX_KEY_LENGTH];
char iv[EVP_MAX_IV_LENGTH];
EVP_CIPHER_CTX ctx;
unsigned char out[512+8];
int outl;
char passwd[] = "password";
EVP_CIPHER *ciph;
EVP_MD *md;


ciph = EVP_bf_cbc();
EVP_BytesToKey(ciph, EVP_md5(), NULL, (unsigned char *)passwd,
strlen(passwd), 1, (unsigned char *)key, (unsigned char *)iv);

// -------------------------------------------------------------------------
----------------------



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to