S盒

執行替換的對稱密鑰算法的基本組件

密码学中,一个S盒Substitution-box替换盒)是對稱密鑰加密算法执行替换计算的基本结构。在块密码中,它们通常用于模糊密钥与密文之间的关系——香农混淆理论[1]

通常,S-Box接受特定数量的输入比特m,并将其转换为特定数量的输出比特n,其中n 不一定等于m[1]。一个m×n的S盒可以通过包含2m条目,每条目n比特的查找表实现。S盒通常是固定的(例如DESAES加密算法), 也有一些加密算法的S盒是基于密钥动态生成的(例如Blowfish双鱼算法加密算法)。

DES的6×4位S盒(S5)是一个很好的例子:

S5 中间四个比特
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
首尾比特 00 0010 1100 0100 0001 0111 1010 1011 0110 1000 0101 0011 1111 1101 0000 1110 1001
01 1110 1011 0010 1100 0100 0111 1101 0001 0101 0000 1111 1010 0011 1001 1000 0110
10 0100 0010 0001 1011 1010 1101 0111 1000 1111 1001 1100 0101 0110 0011 0000 1110
11 1011 1000 1100 0111 0001 1110 0010 1101 0110 1111 0000 1001 1010 0100 0101 0011

给定6比特输入,将首尾两个比特作为行条件、中间四个比特(inner four bits)作为列条件进行查表,最终获得4比特输出。例如,输入“011011”,通过首尾两个比特“01”和中间的比特“1101”进行查表,最终的输出应该是“1001”[2]

参见 编辑

参考文献 编辑

  1. ^ 1.0 1.1 Chandrasekaran, J. et al. A Chaos Based Approach for Improving Non Linearity in the S-Box Design of Symmetric Key Cryptosystems. Meghanathan, N. et al. (编). Advances in Networks and Communications: First International Conference on Computer Science and Information Technology, CCSIT 2011, Bangalore, India, January 2-4, 2011. Proceedings, Part 2. Springer. 2011: 516 [2013-03-23]. ISBN 978-3-642-17877-1. (原始内容存档于2016-05-11). 
  2. ^ Buchmann, Johannes A. 5. DES. Introduction to cryptography Corr. 2. print. New York, NY [u.a.]: Springer. 2001: 119–120. ISBN 0-387-95034-6.