<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=S-box</id>
	<title>S-box - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=S-box"/>
	<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=S-box&amp;action=history"/>
	<updated>2026-08-05T14:43:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.sarg.dev/index.php?title=S-box&amp;diff=163750&amp;oldid=prev</id>
		<title>imported&gt;OAbot: Open access bot: url-access updated in citation with #oabot.</title>
		<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=S-box&amp;diff=163750&amp;oldid=prev"/>
		<updated>2025-05-24T20:28:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/OABOT&quot; class=&quot;extiw&quot; title=&quot;wikipedia:OABOT&quot;&gt;Open access bot&lt;/a&gt;: url-access updated in citation with #oabot.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Basic component of symmetric key algorithms which performs substitution}}&lt;br /&gt;
{{for|the video game engine and platform|S&amp;amp;box (game engine)}}&lt;br /&gt;
In [[cryptography]], an &amp;#039;&amp;#039;&amp;#039;S-box&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;substitution-box&amp;#039;&amp;#039;&amp;#039;) is a basic component of [[symmetric key algorithm]]s which performs substitution. In [[block cipher]]s, they are typically used to obscure the relationship between the key and the [[ciphertext]], thus ensuring [[Claude Shannon|Shannon&amp;#039;s]] property of [[confusion and diffusion|confusion]]. Mathematically, an S-box is a nonlinear{{sfn|Daemen|Rijmen|2013|p=22}} [[vectorial Boolean function]].&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;{{Citation|last=Carlet|first=Claude|title=Vectorial Boolean Functions for Cryptography|date=2010|url=https://www.cambridge.org/core/books/boolean-models-and-methods-in-mathematics-computer-science-and-engineering/vectorial-boolean-functions-for-cryptography/03F4D38804F8CE4ED2CC1939B515100B|work=Boolean Models and Methods in Mathematics, Computer Science, and Engineering|pages=398–470|editor-last=Hammer|editor-first=Peter L.|series=Encyclopedia of Mathematics and its Applications|place=Cambridge|publisher=Cambridge University Press|isbn=978-0-521-84752-0|access-date=2021-04-30|editor2-last=Crama|editor2-first=Yves}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In general, an S-box takes some number of input [[bit]]s, &amp;#039;&amp;#039;m&amp;#039;&amp;#039;, and transforms them into some number of output bits, &amp;#039;&amp;#039;n&amp;#039;&amp;#039;, where &amp;#039;&amp;#039;n&amp;#039;&amp;#039; is not necessarily equal to &amp;#039;&amp;#039;m&amp;#039;&amp;#039;.&amp;lt;ref name=&amp;quot;chandra-516&amp;quot;&amp;gt;{{cite book|author=Chandrasekaran, J. |display-authors=etal |chapter=A Chaos Based Approach for Improving Non Linearity in the S-box Design of Symmetric Key Cryptosystems|editor=Meghanathan, N. |display-editors=etal|title=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|publisher=Springer|year=2011|isbn=978-3-642-17877-1|page=516|chapter-url=https://books.google.com/books?id=pXOS4ZTUJLYC&amp;amp;pg=PA516}}&amp;lt;/ref&amp;gt;  An &amp;#039;&amp;#039;m&amp;#039;&amp;#039;×&amp;#039;&amp;#039;n&amp;#039;&amp;#039; S-box can be implemented as a [[lookup table]] with 2&amp;lt;sup&amp;gt;&amp;#039;&amp;#039;m&amp;#039;&amp;#039;&amp;lt;/sup&amp;gt; words of &amp;#039;&amp;#039;n&amp;#039;&amp;#039; bits each. Fixed tables are normally used, as in the [[Data Encryption Standard]] (DES), but in some [[cipher]]s the tables are generated dynamically from the [[cryptographic key|key]] (e.g. the [[Blowfish (cipher)|Blowfish]] and the [[Twofish]] encryption algorithms).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
One good example of a fixed table is the S-box from DES (S&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt;), mapping 6-bit input into a 4-bit output:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; colspan=&amp;quot;2&amp;quot; | S&amp;lt;sub&amp;gt;5&amp;lt;/sub&amp;gt; || colspan=&amp;quot;16&amp;quot; align=&amp;quot;center&amp;quot; | Middle 4 bits of input&lt;br /&gt;
|-&lt;br /&gt;
! 0000 !! 0001 !! 0010 !! 0011 !! 0100 !! 0101 !! 0110 !! 0111 !! 1000 !! 1001 !! 1010 !! 1011 !! 1100 !! style=&amp;quot;background:#ffdead;&amp;quot; | 1101 !! 1110 !! 1111&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;4&amp;quot; | Outer bits &lt;br /&gt;
! 00 &lt;br /&gt;
| 0010 || 1100 || 0100 || 0001 || 0111 || 1010 || 1011 || 0110 || 1000 || 0101 || 0011 || 1111 || 1101 || style=&amp;quot;background:#ffdead;&amp;quot; | 0000 || 1110 || 1001&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#deffad;&amp;quot; | 01&lt;br /&gt;
| style=&amp;quot;background:#deffad;&amp;quot; | 1110 || style=&amp;quot;background:#deffad;&amp;quot; | 1011 || style=&amp;quot;background:#deffad;&amp;quot; | 0010 || style=&amp;quot;background:#deffad;&amp;quot; | 1100 || style=&amp;quot;background:#deffad;&amp;quot; | 0100 || style=&amp;quot;background:#deffad;&amp;quot; | 0111 || style=&amp;quot;background:#deffad;&amp;quot; | 1101 || style=&amp;quot;background:#deffad;&amp;quot; | 0001 || style=&amp;quot;background:#deffad;&amp;quot; | 0101 || style=&amp;quot;background:#deffad;&amp;quot; | 0000 || style=&amp;quot;background:#deffad;&amp;quot; | 1111 || style=&amp;quot;background:#deffad;&amp;quot; | 1010 || style=&amp;quot;background:#deffad;&amp;quot; | 0011 || style=&amp;quot;background:#fefe2d;&amp;quot; | 1001 || style=&amp;quot;background:#deffad;&amp;quot; | 1000 || style=&amp;quot;background:#deffad;&amp;quot; | 0110&lt;br /&gt;
|-&lt;br /&gt;
! 10&lt;br /&gt;
| 0100 || 0010 || 0001 || 1011 || 1010 || 1101 || 0111 || 1000 || 1111 || 1001 || 1100 || 0101 || 0110 || style=&amp;quot;background:#ffdead;&amp;quot; | 0011 || 0000 || 1110&lt;br /&gt;
|-&lt;br /&gt;
! 11&lt;br /&gt;
| 1011 || 1000 || 1100 || 0111 || 0001 || 1110 || 0010 || 1101 || 0110 || 1111 || 0000 || 1001 || 1010 || style=&amp;quot;background:#ffdead;&amp;quot; | 0100 || 0101 || 0011&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Given a 6-bit input, the 4-bit output is found by selecting the row using the outer two bits (the first and last bits), and the column using the inner four bits. For example, an input &amp;quot;&amp;#039;&amp;#039;&amp;#039;0&amp;#039;&amp;#039;&amp;#039;1101&amp;#039;&amp;#039;&amp;#039;1&amp;#039;&amp;#039;&amp;#039;&amp;quot; has outer bits &amp;quot;&amp;#039;&amp;#039;&amp;#039;01&amp;#039;&amp;#039;&amp;#039;&amp;quot; and inner bits &amp;quot;1101&amp;quot;; the corresponding output would be &amp;quot;1001&amp;quot;.&amp;lt;ref&amp;gt;{{cite book|last=Buchmann|first=Johannes A.|title=Introduction to cryptography|url=https://archive.org/details/introductiontocr00buch_768|url-access=limited|year=2001|publisher=Springer|location=New York, NY [u.a.]|isbn=978-0-387-95034-1|pages=[https://archive.org/details/introductiontocr00buch_768/page/n131 119]–120|edition=Corr. 2. print.|chapter=5. DES}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Analysis and properties ==&lt;br /&gt;
When DES was first published in 1977, the design criteria of its S-boxes were kept secret to avoid compromising the technique of [[differential cryptanalysis]] (which was not yet publicly known). As a result, research in what made good S-boxes was sparse at the time. Rather, the eight S-boxes of DES were the subject of intense study for many years out of a concern that a &amp;#039;&amp;#039;[[Backdoor (computing)|backdoor]]&amp;#039;&amp;#039; (a [[cryptanalysis|vulnerability]] known only to its designers) might have been planted in the cipher. As the S-boxes are the only nonlinear part of the cipher, compromising those would compromise the entire cipher.&amp;lt;ref&amp;gt;{{Cite journal |last=Coppersmith |first=D. |date=May 1994 |title=The Data Encryption Standard (DES) and its strength against attacks |url=https://ieeexplore.ieee.org/document/5389567 |journal=IBM Journal of Research and Development |volume=38 |issue=3 |pages=243–250 |doi=10.1147/rd.383.0243 |issn=0018-8646|url-access=subscription }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The S-box design criteria were eventually published (in {{harvnb|Coppersmith|1994}}) after the public rediscovery of differential cryptanalysis, showing that they had been carefully tuned to increase resistance against this specific attack such that it was no better than [[Brute-force attack|brute force]]. Biham and Shamir found that even small modifications to an S-box could significantly weaken DES.&amp;lt;ref&amp;gt;[http://www.sans.org/reading_room/whitepapers/vpns/s-box-modifications-effect-des-like-encryption-systems_768 Gargiulo&amp;#039;s &amp;quot;S-box Modifications and Their Effect in DES-like Encryption Systems&amp;quot;] {{Webarchive|url=https://web.archive.org/web/20120520040808/http://www.sans.org/reading_room/whitepapers/vpns/s-box-modifications-effect-des-like-encryption-systems_768|date=2012-05-20}}&lt;br /&gt;
p. 9.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any S-box where any linear combination of output bits is produced by a [[bent function]] of the input bits is termed a &amp;#039;&amp;#039;&amp;#039;perfect S-box&amp;#039;&amp;#039;&amp;#039;.&amp;lt;ref&amp;gt;&lt;br /&gt;
RFC 4086.&lt;br /&gt;
Section 5.3 &amp;quot;Using S-boxes for Mixing&amp;quot;&lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
S-boxes can be analyzed using [[linear cryptanalysis]] and [[differential cryptanalysis]] in the form of a [[Linear approximation table]] (LAT) or [[Walsh transform]] and &amp;#039;&amp;#039;Difference Distribution Table&amp;#039;&amp;#039; (DDT) or autocorrelation table and spectrum. Its strength may be summarized by the &amp;#039;&amp;#039;nonlinearity&amp;#039;&amp;#039; (bent, almost bent) and &amp;#039;&amp;#039;differential uniformity&amp;#039;&amp;#039; (perfectly nonlinear, almost perfectly nonlinear).&amp;lt;ref&amp;gt;{{Cite web|last=Heys|first=Howard M.|title=A Tutorial on Linear and Differential Cryptanalysis|url=https://ioactive.com/wp-content/uploads/2015/07/ldc_tutorial.pdf}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite web|title=S-Boxes and Their Algebraic Representations — Sage 9.2 Reference Manual: Cryptography|url=https://doc.sagemath.org/html/en/reference/cryptography/sage/crypto/sbox.html|access-date=2021-04-30|website=doc.sagemath.org}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite book|last=Saarinen|first=Markku-Juhani O.|title=Selected Areas in Cryptography |chapter=Cryptographic Analysis of All 4 × 4-Bit S-Boxes |date=2012|editor-last=Miri|editor-first=Ali|editor2-last=Vaudenay|editor2-first=Serge|series=Lecture Notes in Computer Science|volume=7118|language=en|location=Berlin, Heidelberg|publisher=Springer|pages=118–133|doi=10.1007/978-3-642-28496-0_7|isbn=978-3-642-28496-0|doi-access=free}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Bijection, injection and surjection]]&lt;br /&gt;
* [[Boolean function]]&lt;br /&gt;
* [[Nothing-up-my-sleeve number]]&lt;br /&gt;
* [[Permutation box]] (P-box)&lt;br /&gt;
* [[Permutation cipher]]&lt;br /&gt;
* [[Rijndael S-box]]&lt;br /&gt;
* [[Substitution cipher]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
* {{cite conference&lt;br /&gt;
 |author     = Kaisa Nyberg&lt;br /&gt;
 |author-link     = Kaisa Nyberg&lt;br /&gt;
 |title      = Perfect nonlinear S-boxes&lt;br /&gt;
 |conference = Advances in Cryptology – [[EUROCRYPT]] &amp;#039;91&lt;br /&gt;
 |pages      = 378&amp;amp;ndash;386&lt;br /&gt;
 |date       = 1991&lt;br /&gt;
 |location   = [[Brighton]]&lt;br /&gt;
 |doi =10.1007/3-540-46416-6_32&lt;br /&gt;
|doi-access= free&lt;br /&gt;
 }}&lt;br /&gt;
* {{cite conference&lt;br /&gt;
    | author = S. Mister and [[Carlisle Adams|C. Adams]]&lt;br /&gt;
    | title = Practical S-box Design&lt;br /&gt;
    | conference = Workshop on [[Selected Areas in Cryptography]] (SAC &amp;#039;96) Workshop Record&lt;br /&gt;
    | pages = 61&amp;amp;ndash;76&lt;br /&gt;
    | date = 1996&lt;br /&gt;
    | location = [[Queen&amp;#039;s University at Kingston|Queen&amp;#039;s University]]&lt;br /&gt;
    | citeseerx = 10.1.1.40.7715&lt;br /&gt;
    }}&lt;br /&gt;
* {{cite book&lt;br /&gt;
    | ref = CITEREFSchneier1994&lt;br /&gt;
    | last = Schneier&lt;br /&gt;
    | first = Bruce&lt;br /&gt;
    | author-link = Bruce Schneier&lt;br /&gt;
    | title = Applied Cryptography, Second Edition&lt;br /&gt;
    | url = https://archive.org/details/appliedcryptogra00schn_328&lt;br /&gt;
    | url-access = limited&lt;br /&gt;
    | publisher = [[John Wiley &amp;amp; Sons]]&lt;br /&gt;
    | year = 1996&lt;br /&gt;
    | pages = [https://archive.org/details/appliedcryptogra00schn_328/page/n295 296]&amp;amp;ndash;298, 349&lt;br /&gt;
    | isbn = 978-0-471-11709-4 }}&lt;br /&gt;
&lt;br /&gt;
* {{cite book &lt;br /&gt;
   |last1 = Chuck Easttom&lt;br /&gt;
   |chapter = A generalized methodology for designing non-linear elements in symmetric cryptographic primitives |title = 2018 IEEE 8th Annual Computing and Communication Workshop and Conference (CCWC) |date = 2018 |pages =  444–449&lt;br /&gt;
   |doi = 10.1109/CCWC.2018.8301643|isbn= 978-1-5386-4649-6&lt;br /&gt;
   |s2cid = 3659645 |author1-link = Chuck Easttom }}&lt;br /&gt;
&lt;br /&gt;
==Sources==&lt;br /&gt;
* {{cite book | first1 = Joan | last1 = Daemen | first2 = Vincent | last2 = Rijmen | date = 9 March 2013 | title = The Design of Rijndael: AES - The Advanced Encryption Standard | publisher = Springer Science &amp;amp; Business Media | pages = 22–23 | chapter = Bricklayer Functions | isbn = 978-3-662-04722-4 | oclc = 1259405449 | url = https://cs.ru.nl/~joan/papers/JDA_VRI_Rijndael_2002.pdf}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://www.ciphersbyritter.com/RES/SBOXDESN.HTM A literature survey on S-box design]&lt;br /&gt;
* [http://www.quadibloc.com/crypto/co4513.htm John Savard&amp;#039;s &amp;quot;Questions of S-box Design&amp;quot;]&lt;br /&gt;
* [https://ieeexplore.ieee.org/document/8618346 &amp;quot;Substitution Box Design based on Gaussian Distribution&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
{{Cryptography navbox | block}}&lt;br /&gt;
&lt;br /&gt;
[[Category:S-box| ]]&lt;br /&gt;
[[Category:Cryptographic algorithms]]&lt;/div&gt;</summary>
		<author><name>imported&gt;OAbot</name></author>
	</entry>
</feed>