小编Kon*_*ory的帖子

计算AES加密消息的最大长度

我正在使用此功能使用openssl AES 256 CBC加密数据:

int encryptAES(unsigned char *plaintext, int plaintext_len, unsigned char *key,
  unsigned char *iv, unsigned char *ciphertext)
{
  EVP_CIPHER_CTX *ctx;

  int len;

  int ciphertext_len;

  /* Create and initialise the context */
  if(!(ctx = EVP_CIPHER_CTX_new())) return handleErrors();

  /* Initialise the encryption operation. IMPORTANT - ensure you use a key
   * and IV size appropriate for your cipher
   * In this example we are using 256 bit AES (i.e. a 256 bit key). The
   * IV size for *most* modes …
Run Code Online (Sandbox Code Playgroud)

c encryption openssl

4
推荐指数
1
解决办法
695
查看次数

标签 统计

c ×1

encryption ×1

openssl ×1