Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
最近我继承了一个遗留源代码,以前的开发人员使用 128 位 AES 加密和 20 字节密钥。
我们在其他平台找不到对应部分的实现(我们无法使用其他平台的 AES 库解密加密字符串),是否可以公开 20 字节密钥如何转换为 16 字节密钥的内部逻辑?
系统已经部署了很长时间,更新所有用户的本地密钥非常麻烦。
AES 仅支持 128、192 和 256 位密钥。两种最可能的情况是
\0
获胜者是:用 4 个零字节 ( ) 填充 20 字节密钥,\0以获得与其他 AES 实现兼容的正确密钥。