python - 在 Python 中,有没有办法更改 AES 密码的 block 大小?

标签 python aes pycrypto

在 pycrypto 文档中 http://pythonhosted.org/pycrypto/

block_size 是 AESCipher 的一个变量,设置为 16。 显然是改不了了

我说的对吗?

最佳答案

大概没有办法做到这一点,因为 AES 指定了 128 位(16 字节)的 block 大小。请注意, key 大小是不同的并且可以变化(128、192 或 256 位)。

来自 Understanding Cryptography, chapter 4.2, Overview of the AES Algorithm :

The AES cipher is almost identical to the block cipher Rijndael. The Rijndael block and key size vary between 128, 192 and 256 bits. However, the AES standard only calls for a block size of 128 bits. Hence, only Rijndael with a block length of 128 bits is known as the AES algorithm.

如果您想要一个具有不同 block 大小但在其他方面相同的变体,您应该查看 Rijndael 的实现,而不是 AES。

关于python - 在 Python 中,有没有办法更改 AES 密码的 block 大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21017305/

相关文章:

python - OpenCV-Python接口(interface)、cv和cv2的性能比较

c# - 使用 BouncyCaSTLe 生成无密码的 AES key

c# - 将文本添加到配置文件并在 asp.net 的代码后面使用它

python - 编译 Python 调试和 pip 安装调试库

python - 如何将 ElGamal key 导出到文本文件?

python - 使用 Pycrypto(python) 的 AES 解密不起作用。在 crypto(Nodejs) 中获取正确的解密代码。

Python无法识别目录中的文本文件

python - 从 python 将数据推送到 redshift 数据库时语句太大

JAVA:字符串问题的 128 位 key 和返回

python - python 中的 4d 插值