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.
我需要实现 AES(高级加密标准)。根据标准,在每一轮中,我使用 s-box 替换字节(例如:4F -> 84)。我的问题是我需要将 s-box 作为变量存储在我的 c++ 源代码中,还是可以为每个字节计算它?
S-Box 背后的想法是它在解密期间是可恢复的。因此,S-box 中的值是恒定的。为每个字节计算 S-box 是多余的并且是不必要的重复。
您应该复制并粘贴现有表或在开始时计算一次。该站点有 S-box 初始化的说明和一些示例。