Clever Geek Handbook
📜 ⬆️ ⬇️

Square

SQUARE is a symmetric block cryptographic algorithm in cryptography developed in 1997 by Vincent Rayman , Joan Dimen and Lars Knudsen .

Square
CreatorVincent Rayman ,
Yoan Dimen
Lars Knudsen
Created by1997
Published1997
Key size128 bit
Block size128 bit
Number of rounds8
Type ofWildcard network

Considered the forerunner of the AES algorithm. The structure of the algorithm was chosen by the authors for the possibility of obtaining an effective implementation on a wide range of processors, as well as for cryptographic resistance to differential and linear cryptanalysis.

Content

  • 1 Description of the algorithm
    • 1.1 Transformations in the encryption round
      • 1.1.1 Linear Transformationθ {\ displaystyle \ theta} \ theta
      • 1.1.2 Nonlinear Transformationγ {\ displaystyle \ gamma} \ gamma
      • 1.1.3 Byte Shiftπ {\ displaystyle \ pi} \ pi
      • 1.1.4 Addition with a round keyσ[Ki] {\ displaystyle \ sigma [K_ {i}]} {\ displaystyle \ sigma [K_ {i}]}
    • 1.2 Procedure for obtaining keys
  • 2 Encryption
  • 3 Decryption
  • 4 Security
    • 4.1 The study of cryptographic stability by the creators of the algorithm
      • 4.1.1 Description of the Square attack
  • 5 Cipher Features
  • 6 See also
  • 7 notes
  • 8 Literature
  • 9 References

Algorithm Description

The SQUARE algorithm uses a 128-bit key; data is encrypted with 128-bit blocks; however, the modular approach to building a cipher makes it easy to expand the key length and the length of the data block to large sizes. One round of SQUARE consists of four separate transformations. Data is represented by a 4x4 byte square. The main components of this cipher are five different reversible transformations that affect an array of size bytesfour×four {\ displaystyle 4 \ times 4} 4\times 4 . [one]

Transformations in the Encryption Round

Linear conversionθ {\ displaystyle \ theta} \theta

Linear conversionθ {\ displaystyle \ theta}   affects every row in the data square. It is represented by the formulabi,j=cjai,0⊕cj-oneai,one⊕cj-2ai,2⊕cj-3ai,3 {\ displaystyle {b_ {i, j} = c_ {j} a_ {i, 0} \ oplus c_ {j-1} a_ {i, 1} \ oplus c_ {j-2} a_ {i, 2} \ oplus c_ {j-3} a_ {i, 3}}}   where:

  • ai,j{\ displaystyle {a_ {i, j}}}   Is the value of the byte ini {\ displaystyle i}   th row andj {\ displaystyle j}   -th column in the squared data;
  • bi,j{\ displaystyle {b_ {i, j}}}   - new byte value in a square;
  • cn{\ displaystyle {c_ {n}}}   - set of constants;
  • multiplications are performed in the Galois fieldGF(28) {\ displaystyle {GF (2 ^ {8})}}   ;

Important that the fieldGF(28) {\ displaystyle {GF (2 ^ {8})}}   has characteristic 2, that is, the addition operation corresponds to bitwisexor {\ displaystyle \ mathrm {xor}}   . Eachi {\ displaystyle i}   -th row squared can be represented as a polynomialai(x)=ai,0⊕ai,onex⊕ai,2x2⊕ai,3x3 {\ displaystyle a_ {i} (x) = a_ {i, 0} \ oplus a_ {i, 1} x \ oplus a_ {i, 2} x ^ {2} \ oplus a_ {i, 3} x ^ { 3}}   . Then, determining the coefficientscn {\ displaystyle {c_ {n}}}   like a polynomialc(x)=⊕jcjxj {\ displaystyle {c (x) = \ oplus _ {j} c_ {j} x ^ {j}}}   transformationθ {\ displaystyle \ theta}   can be represented as a product of polynomials:bi(x)=c(x)ai(x)modone⊕xfour {\ displaystyle b_ {i} (x) = c (x) a_ {i} (x) \ mod 1 \ oplus x ^ {4}}   , herebi(x) {\ displaystyle b_ {i} (x)}   - the new value of the row of the square, presented in the form of a polynomial, andc(x)=2⊕one⋅x⊕one⋅x2⊕3⋅x3 {\ displaystyle c (x) = 2 \ oplus 1 \ cdot x \ oplus 1 \ cdot x ^ {2} \ oplus 3 \ cdot x ^ {3}}   . Inverse transformationθ-one {\ displaystyle \ theta ^ {- 1}}   matches polynomiald(x) {\ displaystyle d (x)}   defined by the formulac(x)d(x)=one(modone)⊕xfour {\ displaystyle c (x) d (x) = 1 {\ pmod {1}} \ oplus x ^ {4}}   . [2]

Nonlinear transformationγ {\ displaystyle \ gamma}  

This conversion is a table replacementγ {\ displaystyle \ gamma}   . Table for replacement:

B1CEC3955AADE7024D44Fb910C87A1fifty
CB6754DD468FE14EF0FdFCEBF9C41A6E
5EF5CC8D1C5643FE0761F87559Ff0322
8AD113Ee88000E34fifteen8094E3EDB55323
4B4717A79035AbD8B8Df4F579A92DB1B
3CC899048EE0D77D85BB402C3A45F142
65twenty41eighteen722593703605F20BA379EC08
273132B67CB00A735B7BB781D20D6A26
9E589C8374B3ACthirty7A69770FAe21DED0
2E9710A498A8D4682D6229th6D164976C7
E8C19637E5CAF4E96312C2A6fourteenBCD328
AF2FE62452C6A009Bd8CCF5Deleven5F01C5
9F3DA29BC93BBE51191F3F5CB2Ef4ACD
BfBA6F64D9F33EB4AADCD506C07EF666
6C847138B91D7F9D488B2ADAA5338239
D67886FAE42BA91E89606BEA554CF7E2
 
Conversionπ {\ displaystyle \ pi}  

that is, 0 will be replaced by B1, 1 by CE, and so on. [one]

Byte swapπ {\ displaystyle \ pi}  

Byte permutation transposes the byte square, i.e.ai,j=aj,i {\ displaystyle {a_ {i, j} = a_ {j, i}}}   .

Round Key Additionσ[Ki] {\ displaystyle \ sigma [K_ {i}]}  

This operation is a bitwise addition of 128 bits of data with a round key,b=a⊕Ki {\ displaystyle {b = a \ oplus K_ {i}}}   where:

  • a{\ displaystyle {a}}   andb {\ displaystyle {b}}   - value of 128 data bits before and after conversion;
  • Ki{\ displaystyle {K_ {i}}}   - round keyi {\ displaystyle {i}}   . [2]

The procedure for obtaining keys

For encryption, you need to get 8 128-bit round keys, as well as a key for the preliminary round from the encryption key of the algorithm.

 
Procedureψ {\ displaystyle \ psi}   receiving keys.

The procedure for obtaining the key is described by the conversionψ:Ki+one=ψ(Ki) {\ displaystyle \ psi: K_ {i + 1} = \ psi (K_ {i})}   running on a key represented, like a data block, a 4x4 byte square. Conversionψ {\ displaystyle \ psi}   described by the following operations:

  • k0,i+one=k0,i⊕rotl(k3,i)⊕Ci{\ displaystyle {k_ {0, i + 1} = k_ {0, i} \ oplus rotl (k_ {3, i}) \ oplus C_ {i}}}   ;
  • kone,i+one=kone,i⊕k0,i+one{\ displaystyle {k_ {1, i + 1} = k_ {1, i} \ oplus k_ {0, i + 1}}}   ;
  • k2,i+one=k2,i⊕kone,i+one{\ displaystyle {k_ {2, i + 1} = k_ {2, i} \ oplus k_ {1, i + 1}}}   ;
  • k3,i+one=k3,i⊕k2,i+one{\ displaystyle {k_ {3, i + 1} = k_ {3, i} \ oplus k_ {2, i + 1}}}   ;

Where:

  • kn,i{\ displaystyle {k_ {n, i}}}   -n {\ displaystyle n}   key string byte squarei {\ displaystyle i}   round;
  • Ci{\ displaystyle C_ {i}}   Is a constant fori {\ displaystyle i}   round calculated by the formulaCi+one=2⋅Ci {\ displaystyle {C_ {i + 1} = 2 \ cdot C_ {i}}}   ,C0=one {\ displaystyle C_ {0} = 1}   ;
  • rotl(){\ displaystyle {rotl ()}}   - operation of cyclic shift of a byte string by one byte to the left:rotl[ai,0,ai,one,ai,2,ai,3]=[ai,one,ai,2,ai,3,ai,0] {\ displaystyle rotl [a_ {i, 0}, a_ {i, 1}, a_ {i, 2}, a_ {i, 3}] = [a_ {i, 1}, a_ {i, 2}, a_ {i, 3}, a_ {i, 0}]}   ;

The source key of the encryption algorithm is used as the key for the preliminary round. [2]

Encryption

Denote one round of encryption asρ[kt]=σ[kt]∘π∘γ∘θ {\ displaystyle \ rho [k ^ {t}] = \ sigma [k ^ {t}] \ circ \ pi \ circ \ gamma \ circ \ theta}   . Also, eight rounds of conversion are preceded by key additionσ[K0] {\ displaystyle \ sigma [K_ {0}]}   andθ-one {\ displaystyle \ theta ^ {- 1}}   :Square[k]=ρ[k8]∘ρ[k7]∘ρ[k6]∘ρ[k5]∘ρ[kfour]∘ρ[k3]∘ρ[k2]∘ρ[kone]∘σ[k0]∘θ-one {\ displaystyle \ mathrm {Square} [k] = \ rho [k ^ {8}] \ circ \ rho [k ^ {7}] \ circ \ rho [k ^ {6}] \ circ \ rho [k ^ {5}] \ circ \ rho [k ^ {4}] \ circ \ rho [k ^ {3}] \ circ \ rho [k ^ {2}] \ circ \ rho [k ^ {1}] \ circ \ sigma [k ^ {0}] \ circ \ theta ^ {- 1}}   . [2]

Decryption

The decryption algorithm is similar to the encryption algorithm, but instead of transformationsγ {\ displaystyle \ gamma}   andθ {\ displaystyle \ theta}   reverse conversions are usedγ-one {\ displaystyle \ gamma ^ {- 1}}   andθ-one {\ displaystyle \ theta ^ {- 1}}   , whereinγ-one {\ displaystyle \ gamma ^ {- 1}}   Is a reverse table replacement, andθ-one {\ displaystyle \ theta ^ {- 1}}   Is a multiplication of a line by a polynomiald(x) {\ displaystyle d (x)}   such thatd(x)c(x)=one(modone⊕xfour) {\ displaystyle d (x) c (x) = 1 {\ pmod {1 \ oplus x ^ {4}}}}   , also in the preliminary round the transformation is usedθ {\ displaystyle \ theta}   insteadθ-one {\ displaystyle \ theta ^ {- 1}}   . The encryption formula shows that

Square-one[k]=θ∘σ-one[k0]∘ρ-one[kone]∘ρ-one[k2]∘ρ-one[k3]∘ρ-one[kfour]∘ρ-one[k5]∘ρ-one[k6]∘ρ-one[k7]∘ρ-one[k8]{\ displaystyle \ mathrm {Square ^ {- 1}} [k] = \ theta \ circ \ sigma ^ {- 1} [k ^ {0}] \ circ \ rho ^ {- 1} [k ^ {1} ] \ circ \ rho ^ {- 1} [k ^ {2}] \ circ \ rho ^ {- 1} [k ^ {3}] \ circ \ rho ^ {- 1} [k ^ {4}] \ circ \ rho ^ {- 1} [k ^ {5}] \ circ \ rho ^ {- 1} [k ^ {6}] \ circ \ rho ^ {- 1} [k ^ {7}] \ circ \ rho ^ {- 1} [k ^ {8}]}   ,

Whereρ-one[kt]=θ-one∘γ-one∘π-one∘σ-one[kt]=θ-one∘γ-one∘π∘σ[kt] {\ displaystyle \ rho ^ {- 1} [k ^ {t}] = \ theta ^ {- 1} \ circ \ gamma ^ {- 1} \ circ \ pi ^ {- 1} \ circ \ sigma ^ {- 1} [k ^ {t}] = \ theta ^ {- 1} \ circ \ gamma ^ {- 1} \ circ \ pi \ circ \ sigma [k ^ {t}]}   . Asγ-one∘π=π∘γ-one {\ displaystyle \ gamma ^ {- 1} \ circ \ pi = \ pi \ circ \ gamma ^ {- 1}}   , and, moreover, sinceθ-one(a)⊕kt=θ-one(a+θ(kt)) {\ displaystyle \ theta ^ {- 1} (a) \ oplus k ^ {t} = \ theta ^ {- 1} (a + \ theta (k ^ {t}))}   we getσ[kt]∘θ-one=θ-one∘σ[θ(kt)] {\ displaystyle \ sigma [k ^ {t}] \ circ \ theta ^ {- 1} = \ theta ^ {- 1} \ circ \ sigma [\ theta (k ^ {t})]}   . Now one round for decryption can be defined asρ′[kt]=σ[kt]∘π∘γ-one∘θ-one {\ displaystyle \ rho '[k ^ {t}] = \ sigma [k ^ {t}] \ circ \ pi \ circ \ gamma ^ {- 1} \ circ \ theta ^ {- 1}}   , and the full formula for decryption is written as:

Square-one=ρ′[k8]∘ρ′[k7]∘ρ′[k6]∘ρ′[k5]∘ρ′[kfour]∘ρ′[k3]∘ρ′[k2]∘ρ′[kone]∘σ[k0]∘θ{\ displaystyle \ mathrm {Square} ^ {- 1} = \ rho '[k ^ {8}] \ circ \ rho' [k ^ {7}] \ circ \ rho '[k ^ {6}] \ circ \ rho '[k ^ {5}] \ circ \ rho' [k ^ {4}] \ circ \ rho '[k ^ {3}] \ circ \ rho' [k ^ {2}] \ circ \ rho '[k ^ {1}] \ circ \ sigma [k ^ {0}] \ circ \ theta}   . [2]

Security

The study of cryptographic stability by the creators of the algorithm

The algorithm is highly resistant to linear and differential cryptanalysis thanks to transformationsθ {\ displaystyle \ theta}   andγ {\ displaystyle \ gamma}   which reduce the maximum probability of the appearance of differential traces and the maximum correlation of linear traces in 4 rounds of transformations. The first SQUARE cryptanalysis was carried out by its authors using integrated cryptanalysis , which later became known as Square attack. [2]

Square Attack Description

First of all, we’ll introduce some definitions,

Definition 1: LetΛ {\ displaystyle \ Lambda}   -set - a set of 256 16-byte states, each of which differs from the others in some bytes, which we will call active, and coincide in some bytes, which we will call passive. Further,λ {\ displaystyle \ lambda}   Is a set of indexes of active bytes. [3] We have:

∀x,y∈Λ:{xi,j≠yi,j,for(i,j)∈λxi,j=yi,j,for(i,j)∉λ{\ displaystyle \ forall x, y \ in \ Lambda: {\ begin {cases} x_ {i, j} \ neq y_ {i, j}, for (i, j) \ in \ lambda \\ x_ {i, j} = y_ {i, j}, for (i, j) \ notin \ lambda \ end {cases}}}   .

Definition 2: If applying an exclusive “or” operation to all bytes at the same position inΛ {\ displaystyle \ Lambda}   -set gives 0, then this position is called balancedΛ {\ displaystyle \ Lambda}   - a lot. [3]

Applying transformationsγ {\ displaystyle \ gamma}   andσ[kt] {\ displaystyle \ sigma [k ^ {t}]}   toΛ {\ displaystyle \ Lambda}   - gives a lotΛ {\ displaystyle \ Lambda}   -set with the sameλ {\ displaystyle \ lambda}   . Conversion applicationπ {\ displaystyle \ pi}   givesΛ {\ displaystyle \ Lambda}   -set in which active bytes are transposed (relative to active bytes in the originalΛ {\ displaystyle \ Lambda}   -Many). Also, applicationθ {\ displaystyle \ theta}   toΛ {\ displaystyle \ Lambda}   - many will not necessarily returnΛ {\ displaystyle \ Lambda}   -set, however, since each output byteθ {\ displaystyle \ theta}   is a linear combination of four input bytes in the same line, then, submitting a line with only one active byte, the output will receive a line consisting of only active bytes. [2] ConsiderΛ {\ displaystyle \ Lambda}   - a set in which only one byte is active and follow how the position of the active byte changes over three rounds (here the preliminary round is combined with the first:ρ[kone]∘σ[k0]∘θ-one {\ displaystyle \ rho [k ^ {1}] \ circ \ sigma [k ^ {0}] \ circ \ theta ^ {- 1}}   which ultimately is written asσ[kone]∘π∘γ∘θ∘σ[k0]∘θ-one=σ[kone]∘π∘γ∘σ[θ(k0)] {\ displaystyle \ sigma [k ^ {1}] \ circ \ pi \ circ \ gamma \ circ \ theta \ circ \ sigma [k ^ {0}] \ circ \ theta ^ {- 1} = \ sigma [k ^ {1}] \ circ \ pi \ circ \ gamma \ circ \ sigma [\ theta (k ^ {0})]}   ) Since the first round does not containθ {\ displaystyle \ theta}   , then by the beginning of the second round remains one active byte. In the second roundθ {\ displaystyle \ theta}   converts to a string of active bytes thatπ {\ displaystyle \ pi}   converts to a column of active bytes.θ {\ displaystyle \ theta}   in the third round translates the result intoΛ {\ displaystyle \ Lambda}   -set consisting of only active bytes. The byte values ​​at the output of the third round run through all possible values, therefore, are balanced by the setΛ {\ displaystyle \ Lambda}   , we have

⨁b=θ(a),a∈Λbi,j=⨁a∈Λ⨁kcj-kai,k=⨁ l c l ⨁ a ∈ Λ a i , l + j = ⨁ l c l 0 = 0 ,{\ displaystyle {\ underset {b = \ theta (a), a \ in \ Lambda} {\ bigoplus}} b_ {i, j} = {\ underset {a \ in \ Lambda} {\ bigoplus}} {\ underset {k} {\ bigoplus}} c_ {jk} a_ {i, k} = {\ underset {l} {\ bigoplus}} c_ {l} {\ underset {a \ in \ Lambda} {\ bigoplus}} a_ {i, l + j} = {\ underset {l} {\ bigoplus}} c_ {l} 0 = 0,}  

means bytes on an outputθ {\ displaystyle \ theta}   in the fourth round balanced byΛ {\ displaystyle \ Lambda}   - a lot. This equilibrium is violated by subsequent application.γ {\ displaystyle \ gamma}   . The output bytes of the fourth round can be expressed using a function of the intermediate stateb {\ displaystyle b}   :ai,j=Sγ[bj,i]⊕ki,jfour {\ displaystyle a_ {i, j} = S _ {\ gamma} [b_ {j, i}] \ oplus k_ {i, j} ^ {4}}   . Assuming valueki,jfour {\ displaystyle k_ {i, j} ^ {4}}   , valuebj,i {\ displaystyle b_ {j, i}}   for all elementsΛ {\ displaystyle \ Lambda}   -set can be computed from ciphertexts. If the value of this byte is unbalanced byΛ {\ displaystyle \ Lambda}   , then the expected key valueki,jfour {\ displaystyle k_ {i, j} ^ {4}}   is false. This cryptanalysis method allowed to crack a 6-round version of the cipher using232 {\ displaystyle 2 ^ {32}}   plaintext blocks and their corresponding ciphertext blocks and execution272 {\ displaystyle 2 ^ {72}}   encryption operations. [2]

In 2010, a boomerang-based attack on bound keys was introduced. Previously, a similar attack was applied to the KASUMI , COCONUT98 , IDEA, and AES-192/256 ciphers. This was the first attack on a full-round square. [4] In 2011, a full-round version of SQUARE was cryptanalyzed using a full bipartite graph . This type of attack allowed to crack the cipher using one key,248 {\ displaystyle 2 ^ {48}}   plaintext and holding2126 {\ displaystyle 2 ^ {126}}   encryption operations. [5]

Cipher Features

The SQUARE cipher was created in accordance with the strategy of a wide trace - each round of the cipher consists of several transformations, non-linear permutation and composition of linear transformations - which gave the cipher high cryptographic strength against linear and differential cryptanalysis, the components of the algorithm and their interaction were also selected based on the possibility of quick implementation on a wide range of processors. [6] The implementation of the algorithm in the C language had an encryption speed of 2.63 MB / s, running on a Pentium processor with a frequency of 100 MHz, and the implementation in the assembler language increased the encryption speed by half. This algorithm was developed and became the basis of the new American standard - the Rijndael cipher, which was developed by a team of SQUARE authors. By the way, at the AES contest, experts noted that "the Rijndael algorithm is based on an unconventional paradigm, so it may contain hidden vulnerabilities" [1] . For this reason, SQUARE itself is rarely used now, inferior in popularity to its descendant - Rijndael. Also a descendant of the cipher is the South Korean algorithm CRYPTON , a participant in the AES contest.

See also

  • Rijndael

Notes

  1. ↑ 1 2 3 Panasenko, 2009 .
  2. ↑ 1 2 3 4 5 6 7 8 The Block Cipher SQUARE, 1997 .
  3. ↑ 1 2 Impossible di ff erential and square attacks: Cryptanalytic link and application to Skipjack, 2001 .
  4. ↑ Koo, Yeom, Song, 2010 .
  5. ↑ Biclique Cryptanalisis of the Block Cipher SQUARE, 2011 .
  6. ↑ The Block Cipher Square Algorithm

Literature

  • J. Daemen, L. Knudsen, V. Rijmen. The Block Cipher SQUARE . - 1997.
  • B. Koo, Y. Yeom, J. Song. Related-Key Boomerang Attack on Block Cipher SQUARE . - 2010.
  • H. Mala. Biclique Cryptanalisis of the Block Cipher SQUARE . - 2011.
  • G. Piret, J.-J. Quisquater. Impossible di ff erential and square attacks: Cryptanalytic link and application to Skipjack . - 2001.
  • Panasenko S.P. Encryption Algorithms. Special Reference - SPb. : BHV-SPb , 2009 .-- 576 p. - ISBN 978-5-9775-0319-8
    <a href=" https://wikidata.org/wiki/Track:Q27942697 "> </a> <a href=" https://wikidata.org/wiki/Track:Q27942695 "> </a> <a href = " https://wikidata.org/wiki/Track:Q27942699 "> </a>

Links

  • The Block Cipher Square Algorithm , Joan Daemen, Lars R. Knudsen and and Vincent Rijmen, Dr. Dobb's Journal , October 01, 1997.
Source - https://ru.wikipedia.org/w/index.php?title=SQUARE&oldid=97499829


More articles:

  • Kolganov, Vladimir Nikolaevich
  • Church of Elijah the Prophet (Nizhny Novgorod)
  • Grand Cru
  • Battle of Lipantitlan
  • Vilnius Academy of Medical Surgery
  • Novel from Pariah of the Hellespont
  • Republic of China
  • Z-Sides
  • List of Heads of State in 1917
  • General Cortes of Spain

All articles

Clever Geek | 2019