c++ - 无法使用 Intel AES-NI 示例库以 32 字节 block 大小进行加密/解密

标签 c++ encryption aes intel aes-ni

我尝试在 Visual Studio 上将 intel_aes_c 库与 C++ 一起使用来创建一种以 32 字节 block 大小进行加密的加密方法,但即使执行 #define BLOCK_SIZE (32) 也没有真正帮助。

一般来说,我想问一下如何在英特尔 AES-NI 示例库中设置 block 大小。任何帮助或澄清指出我正确的方式将不胜感激,谢谢!

最佳答案

据我所知,纯文本的 block 大小无法使用 AES-NI 进行更改(如果要对其进行加密)。这是英特尔指定的:

The AES algorithm works by encrypting a fixed block size of 128 bits of plain text in several rounds to produce the final encrypted cipher text. The number of rounds (10, 12, or 14) used depends on the key length (128b, 192b, or 256b). Each round performs a sequence of steps on the input state, which is then fed into the following round. Each round is encrypted using a subkey that is generated using a key schedule. For more details on AES please refer to 1. - Link

最后(1)提到的引用文献是指a wikipedia article关于 AES,其中指出:

AES is a variant of Rijndael which has a fixed block size of 128 bits, and a key size of 128, 192, or 256 bits.

关于c++ - 无法使用 Intel AES-NI 示例库以 32 字节 block 大小进行加密/解密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21180556/

相关文章:

c# - 如何使用 SHA512 散列密码

ios - 以加密格式获取钥匙串(keychain)密码

ios - 使用 AES 进行数据加密

c# - 使用 BouncyCaSTLe : AESEngine, AESFastEngine 或 AESLightEngine 进行 AES 加密?

c++ - 如何使用 boost.log 以 dec 格式打印 ProcessID 和 ThreadID

c++ - 具有局部静态变量的 ID 生成器 - 线程安全?

c++ - 在 netbeans 的项目中编译单个文件

c++ - 二维数组的指针

java - 使用 AES CBC Java 加密

java - PHP、Java、Javascript 之间的 AES 互操作性