Regarding EVP_EncryptFinal_ex()

       If padding is enabled (the default) then EVP_EncryptFinal_ex() encrypts
       the "final" data, that is any data that remains in a partial block.  It
       uses standard block padding (aka PKCS padding). The encrypted final
       data is written to out which should have sufficient space for one
       cipher block. The number of bytes written is placed in outl. After this
       function is called the encryption operation is finished and no further
       calls to EVP_EncryptUpdate() should be made.

use EVP_EncryptFinal to Pad Encryption

Source code in Openssl
int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
 int i,n,b,bl,ret;
 OPENSSL_assert(b <= sizeof ctx->buf);
 if (b == 1)
  return 1;
 if (ctx->flags & EVP_CIPH_NO_PADDING)
   return 0;
  *outl = 0;
  return 1;
 for (i=bl; i<b; i++)

 return ret;

台北-內灣, 內灣-台北火車時刻

車種        車次        起點      終點 時間               票價 行駛
區間車     2143  —  台北 至 新竹  09:06  10:33  125    1小時37分  每日行駛。 
冷氣柴客 3267  —  新竹 至 內灣  10:52  11:46  41      54分       每日行駛。
冷氣柴客 130    —  內灣 至 新竹  16:36  17:47  41      54分       六日行駛。
區間車     2238  —  新竹 至 台北  17:50  19:15  125    1小時35分  每日行駛。