lauding wrote:
> Hi:
> My system is centos 5.0, the openssl version is
> openssl-0.9.8b-8.3.el5_0.2. which is installed by yum mod_ssl.


> AES_cbc_encrypt(szSorPlainText, szCipherText, iInputLen, &key,
> szIniVec, AES_ENCRYPT);
> iCipherLen = strlen(szCipherText);

Your problem lies in treating binary data as a C-string. Binary data can
have 0s in between, so don't use str*() friends on it.

Please consider using EVP_Encrypt*() functions; for documentation read
the EVP_EncryptInit() man page and the example given in it.

I used to think I was indecisive, but now I'm not so sure.
__________________________________________________ ____________________
OpenSSL Project
User Support Mailing List
Automated List Manager