我需要在 CTR 模式下使用 128 位 AES 算法来从 openssl 库进行加密。
但似乎相应的函数AES_ctr128_encrypt已从openssl 1.1.0g中删除。因为我收到以下错误:-
Documentation or references from internet does not suggest the alternate function for AES CTR mode.
What is the exact alternate for AES_ctr128_encrypt with openssl 1.1.0g?
对于 mnistic 的回答,我只想补充一点,你不应该忘记包含这些标头:
- openssl/aes.h
- openssl/modes.h
那么这个:
AES_ctr128_encrypt(
cipher_in,
plaintext_out,
bytes_length,
&cipher->aes_key->key,
cipher->aes_key->IV,
counter,
&offset);
会成为:
#include <openssl/aes.h>
#include <openssl/modes.h>
.
.
.
CRYPTO_ctr128_encrypt(
cipher_in,
plaintext_out,
bytes_length,
&cipher->aes_key->key,
cipher->aes_key->IV,
counter,
&offset,
(block128_f)AES_encrypt);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)