ArticleslgStudy

computer science

S-box

S-box is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand S-box rather than just read about it. In short: In cryptography, an S-box (substitution-box) is a basic component of symmetric key algorithms which performs substitution. In block ciphers, they are typically used to obscure the relationship between the key and the ciphertext, thus ensuring Shannon's property of confusion.

Key takeaways

  • S-box belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect S-box to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of S-box from memory before moving on to harder problems.

Reference excerpt

In cryptography, an S-box (substitution-box) is a basic component of symmetric key algorithms which performs substitution. In block ciphers, they are typically used to obscure the relationship between the key and the ciphertext, thus ensuring Shannon's property of confusion. Mathematically, an S-box is a nonlinear vectorial Boolean function. In general, an S-box takes some number of input bits, m, and transforms them into some number of output bits, n, where n is not necessarily equal to m. An m×n S-box can be implemented as a lookup table with 2m words of n bits each. Fixed tables are normally used, as in the Data Encryption Standard (DES), but in some ciphers the tables are generated dynamically from the key (e.g. the Blowfish and the Twofish encryption algorithms).

Example One good example of a fixed table is the S-box from DES (S5), mapping 6-bit input into a 4-bit output:

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 "011011" has outer bits "01" and inner bits "1101"; the corresponding output would be "1001".

Analysis and properties 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 backdoor (a 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. The S-box design criteria were eventually published (in 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. Biham and Shamir found that even small modifications to an S-box could significantly weaken DES. Any S-box where any linear combination of output bits is produced by a bent function of the input bits is termed a perfect S-box. S-boxes can be analyzed using linear cryptanalysis and differential cryptanalysis in the form of a Linear approximation table (LAT) or Walsh transform and Difference Distribution Table (DDT) or autocorrelation table and spectrum. Its strength may be summarized by the nonlinearity (bent, almost bent) and differential uniformity (perfectly nonlinear, almost perfectly nonlinear).

See also Bijection, injection and surjection Boolean function Nothing-up-my-sleeve number Permutation box (P-box) Permutation cipher Rijndael S-box Substitution cipher

References

Further reading Kaisa Nyberg (1991). Perfect nonlinear S-boxes. Advances in Cryptology – EUROCRYPT '91. Brighton. pp. 378–386. doi:10.1007/3-540-46416-6_32. S. Mister and C. Adams (1996). Practical S-box Design. Workshop on Selected Areas in Cryptography (SAC '96) Workshop Record. Queen's University. pp. 61–76. CiteSeerX 10.1.1.40.7715. {{cite conference}}: Cite uses deprecated parameter |citeseerx= (help) Schneier, Bruce (1996). Applied Cryptography, Second Edition. John Wiley & Sons. pp. 296–298, 349. ISBN 978-0-471-11709-4. Chuck Easttom (2018). "A generalized methodology for designing non-linear elements in symmetric cryptographic primitives". 2018 IEEE 8th Annual Computing and Communication Workshop and Conference (CCWC). pp. 444–449. doi:10.1109/CCWC.2018.8301643. ISBN 978-1-5386-4649-6. S2CID 3659645.

Sources Daemen, Joan; Rijmen, Vincent (9 March 2013). "Bricklayer Functions". The Design of Rijndael: AES - The Advanced Encryption Standard (PDF). Springer Science & Business Media. pp. 22–23. ISBN 978-3-662-04722-4. OCLC 1259405449.

External links A literature survey on S-box design John Savard's "Questions of S-box Design" "Substitution Box Design based on Gaussian Distribution"

Worked examples

Example 1 — a first encounter with S-box

Start with the simplest possible case. Write down what S-box claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to S-box before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about S-box ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of S-box

In research
S-box appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses S-box in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
S-box is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cryptographic algorithms, S-box, so understanding it makes those chapters shorter.
In everyday life
Look for S-box outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study S-box in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what S-box means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain S-box out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is S-box in simple terms?

In cryptography, an S-box (substitution-box) is a basic component of symmetric key algorithms which performs substitution. In block ciphers, they are typically used to obscure the relationship between the key and the ciphertext, thus ensuring Shannon's property of confusion.

Why does S-box matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study S-box?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on S-box.

Tags

  • Cryptographic algorithms
  • S-box

Keep exploring