Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Substitution–permutation network
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Cipher design construction}} [[Image:SubstitutionPermutationNetwork-en.svg|thumb|360px|right|A sketch of a substitution–permutation network with 3 rounds, encrypting a plaintext block of 16 bits into a ciphertext block of 16 bits. The S-boxes are the ''S<sub>i</sub>'', the P-boxes are the same ''P'', and the round keys are the ''K<sub>i</sub>''.]] In [[cryptography]], an '''SP-network''', or '''substitution–permutation network''' ('''SPN'''), is a series of linked mathematical operations used in [[block cipher]] algorithms such as [[Advanced Encryption Standard|AES (Rijndael)]], [[3-Way]], [[Kalyna (cipher)| Kalyna]], [[Kuznyechik]], [[PRESENT (cipher)|PRESENT]], [[Secure and Fast Encryption Routine|SAFER]], [[SHARK]], and [[Square (cipher)|Square]]. Such a network takes a block of the [[plaintext]] and the [[key (cryptography)|key]] as inputs, and applies several alternating ''rounds'' or ''layers'' of [[substitution box]]es (S-boxes) and [[permutation box]]es (P-boxes) to produce the [[ciphertext]] block. The S-boxes and P-boxes transform {{nobr|(sub-)blocks}} of input [[bit]]s into output bits. It is common for these transformations to be operations that are efficient to perform in hardware, such as [[exclusive disjunction|exclusive or]] (XOR) and [[bitwise rotation]]. The key is introduced in each round, usually in the form of "[[round key]]s" derived from it. (In some designs, the [[S-box]]es themselves depend on the key.) [[Decryption]] is done by simply reversing the process (using the inverses of the S-boxes and P-boxes and applying the round keys in reversed order). == Components == An [[S-box]] substitutes a small block of bits (the input of the S-box) by another block of bits (the output of the S-box). This substitution should be [[bijective|one-to-one]], to ensure invertibility (hence decryption). In particular, the length of the output should be the same as the length of the input (the picture on the right has S-boxes with 4 input and 4 output bits), which is different from S-boxes in general that could also change the length, as in [[Data Encryption Standard]] (DES), for example. An S-box is usually not simply a [[permutation]] of the bits. Rather, in a good S-box each output bit will be affected by every input bit. More precisely, in a good S-box each output bit will be changed with 50% probability by every input bit. Since each output bit changes with the 50% probability, about half of the output bits will actually change with an input bit change (cf. [[Strict avalanche criterion]]).<ref name="webster_tavares_1985">{{cite book|first1=A. F.|last1= Webster |first2=Stafford E. |last2=Tavares|chapter=On the design of S-boxes|title=Advances in Cryptology – Crypto '85 |series=Lecture Notes in Computer Science|volume=218|pages= 523–534|year=1985|isbn=0-387-16463-4|publisher=Springer-Verlag New York, Inc. |location= New York, NY}}</ref> A [[Permutation box|P-box]] is a [[permutation]] of all the bits: it takes the outputs of all the S-boxes of one round, permutes the bits, and feeds them into the S-boxes of the next round. A good P-box has the property that the output bits of any S-box are distributed to as many S-box inputs as possible. At each round, the [[round key]] (obtained from the [[key (cryptography)|key]] with some simple operations, for instance, using S-boxes and P-boxes) is combined using some group operation, typically [[XOR]]. == Properties == A single typical S-box or a single P-box alone does not have much cryptographic strength: an S-box could be thought of as a [[substitution cipher]], while a P-box could be thought of as a [[transposition cipher]]. However, a well-designed SP network with several alternating rounds of S- and P-boxes already satisfies '''Shannon's [[confusion and diffusion]] properties''': * The reason for '''diffusion''' is the following: If one changes one bit of the plaintext, then it is fed into an S-box, whose output will change at several bits, then all these changes are distributed by the P-box among several S-boxes, hence the outputs of all of these S-boxes are again changed at several bits, and so on. Doing several rounds, each bit changes several times back and forth, therefore, by the end, the ciphertext has changed completely, in a [[pseudorandom]] manner. In particular, for a randomly chosen input block, if one flips the ''i''-th bit, then the probability that the ''j''-th output bit will change is approximately a half, for any ''i'' and ''j'', which is the [[strict avalanche criterion]]. Vice versa, if one changes one bit of the ciphertext, then attempts to decrypt it, the result is a message completely different from the original plaintext—SP ciphers are not easily [[malleability (cryptography)|malleable]]. * The reason for '''confusion''' is exactly the same as for diffusion: changing one bit of the key changes several of the round keys, and every change in every round key [[diffuse]]s over all the bits, changing the ciphertext in a very complex manner. * If an attacker somehow obtains one plaintext corresponding to one ciphertext—a [[known-plaintext attack]], or worse, a [[chosen plaintext]] or [[chosen-ciphertext attack]]—the confusion and diffusion make it difficult for the attacker to recover the key. == Performance == Although a [[Feistel network]] that uses S-boxes (such as [[Data Encryption Standard|DES]]) is quite similar to SP networks, there are some differences that make either this or that more applicable in certain situations. For a given amount of [[confusion and diffusion]], an SP network has more "inherent parallelism"<ref> [http://www.ddj.com/184410756 "Principles and Performance of Cryptographic Algorithms"] by Bart Preneel, Vincent Rijmen, and Antoon Bosselaers. </ref> and so — given a CPU with many [[execution unit]]s — can be computed faster than a Feistel network.<ref>[http://www.schneier.com/skein1.1.pdf "The Skein Hash Function Family"] {{Webarchive|url=https://web.archive.org/web/20090115213250/http://www.schneier.com/skein1.1.pdf |date=2009-01-15 }} 2008 by [[Niels Ferguson]], [[Stefan Lucks]], [[Bruce Schneier]], Doug Whiting, [[Mihir Bellare]], Tadayoshi Kohno, [[Jon Callas]], Jesse Walker page 40.</ref> CPUs with few execution units — such as most [[smart card]]s — cannot take advantage of this inherent parallelism. Also SP ciphers require S-boxes to be invertible (to perform decryption); Feistel inner functions have no such restriction and can be constructed as [[one-way function]]s. == See also == * [[Feistel network]] * [[Product cipher]] * [[Square (cipher)]] * [[International Data Encryption Algorithm]] ==References== {{Reflist}} ==Further reading== *{{cite book |first=Jonathan |last=Katz |first2=Yehuda |last2=Lindell |title=Introduction to Modern Cryptography |url=https://archive.org/details/Introduction_to_Modern_Cryptography |publisher=CRC Press |year=2007 |isbn=9781584885511 }} *{{cite book |first=Douglas R. |last=Stinson |title=Cryptography. Theory and Practice |edition=Third |publisher=Chapman & Hall/CRC |year=2006 |isbn=1584885084 }} {{Cryptography navbox | block}} {{DEFAULTSORT:Substitution-permutation network}} [[Category:Cryptographic algorithms]] [[Category:Block ciphers]] [[Category:Permutations]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cryptography navbox
(
edit
)
Template:Nobr
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Webarchive
(
edit
)