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.
I try to test AES_set_encrypt_key method. The sorce plaintext is "userid=6DD024C9F68E894BEFECFE3D7A12E5BA+time=1204862415". After a encryption and decryption process, the result turn out to be "userid=6DD024C9F68E894BEFECFE3D7A12E5BA+time=120"; It seems that the result's length is the exact times of the block length. I don't know why. The following is my code. Appreciating for your answer. char szBytes[]="BF19EBA2E16593F90196272F131061B1E911FF37A7BA4019D846889FDB99EF16A 90B024EF5D4B45EDE260DD045A7376B5B2107A73EDDE27C747F91794E4E55A6"; unsigned char arrKey[] = "AaCD,F0~12345678"; unsigned int iKeyLen = strlen(arrKey); unsigned char szSorPlainText[256]= "userid=6DD024C9F68E894BEFECFE3D7A12E5BA+time=1204862415"; unsigned char szCipherText[256]; unsigned char szIniVec[]="12345678asdfghjk"; unsigned char szDesPlainText[256]; int iRet = 0; int iInputLen = strlen(szSorPlainText); int iCipherLen = 0; int i = 0; AES_KEY key; memset(szCipherText, 0, 256); iRet = AES_set_encrypt_key(arrKey, iKeyLen<<3, &key); AES_cbc_encrypt(szSorPlainText, szCipherText, iInputLen, &key, szIniVec, AES_ENCRYPT); iCipherLen = strlen(szCipherText); iRet = AES_set_decrypt_key(arrKey, iKeyLen<<3, &key); strcpy(szIniVec, "12345678asdfghjk"); memset(szDesPlainText, 0, 256); AES_cbc_encrypt(szCipherText, szDesPlainText,iCipherLen, &key, szIniVec, AES_DECRYPT);