unsigned char key[] = {0xe3,0xc2,0x54,0xb6,0xec,0x97,0x6b,0x46,0x38,0xf2,0x16,0xc8,0x3d,0xe6,0x15,0x04,0x16,0x6d,0x70,0x70,0xae,0x97,0xbf,0xb6};
unsigned char iv[] = {0x4e,0xed,0x0d,0x2f,0x1c,0x48,0xe0,0xf1};
unsigned char encrypted[] = {0xca,0x99,0x19,0x61,0xd1,0x21,0x4f,0x77,0x3e,0x0d,0xd3,0xcc,0x07,0x9f,0x56,0x24};
const EVP_CIPHER* cipherType = EVP_des_ede3_ecb();
EVP_CIPHER_CTX ctx;
EVP_CIPHER_CTX_init(&ctx);
int rt = EVP_DecryptInit(&ctx, (const EVP_CIPHER*)cipherType, (const unsigned char*)key, (const unsigned char*)iv);
int out_len;
char ciphertext[2048] = {0};
memset(ciphertext, 0x00, sizeof(ciphertext));
rt = EVP_DecryptUpdate(&ctx, (unsigned char*)ciphertext, &out_len, (const unsigned char*)encrypted, 16);
rt = EVP_DecryptFinal(&ctx, (unsigned char*)ciphertext, &out_len);
rt = EVP_CIPHER_CTX_cleanup(&ctx);
http://stackoverflow.com/questions/8528995/openssl-c-3des-file-encryption-decryption-fail