在 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/