Re: the decrypted data is truncated.
> 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 [url]http://www.openssl.org[/url]
User Support Mailing List [email]firstname.lastname@example.org[/email]
Automated List Manager [email]email@example.com[/email]