Block ciphers

Square

Daemen, Knudsen and Rijmen's 1997 128-bit substitution-permutation cipher, a precursor to Rijndael

unverified Root API only
Unverified tier.

Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.

About Square

Square is a block cipher. It uses a 16-byte (128-bit) key and a 16-byte (128-bit) block. Its registry entry cites Square (Daemen, Knudsen, Rijmen, 1997), Crypto++ implementation. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).

Overview

Square is a 128-bit block cipher with a 128-bit key, proposed in 1997 by Joan Daemen, Lars Knudsen and Vincent Rijmen. It is a substitution-permutation network and a direct predecessor of Rijndael, the cipher standardised as AES. NextSSL carries it as an unverified Crypto++ implementation.

Square was proposed in 1997 by Joan Daemen, Lars Knudsen and Vincent Rijmen. It is a 128-bit block cipher with a 128-bit key, and its round structure of byte substitution, byte permutation and a mixing layer became the basis for Rijndael. Square is also the source of the Square attack, a cryptanalytic technique that targets reduced-round versions of the design.

NextSSL carries the single variant square with a 16-byte key and a 16-byte block, following a Crypto++ implementation. The 128-bit block gives a birthday bound of about 2 to the power of 64 blocks, which is comfortable for most uses.

The unverified tier reflects the archive's review status. Square has been superseded by Rijndael, so its main value now is historical and as a reference for the design lineage behind AES.

History

1997–1997
  1. Square published by Joan Daemen, Lars Knudsen, Vincent Rijmen

How it works

  1. The 128-bit key is expanded into round keys.
  2. Each round applies a byte-wise substitution layer, a byte permutation and a linear mixing layer over the block.
  3. Decryption applies the inverse of each layer in reverse round order.

Security notes

Unverified in NextSSL. Square is a reduced-round target of the Square attack, and it is superseded by Rijndael and AES, which should be used instead.

Typical uses

Historical study of the AES design lineageResearch on the Square attack and related analysisCrypto++ compatibility testing

Sizes

FieldBytesMeaning
key16Secret key
block16Block

Use it

from nextssl_demo import NextSSL

root = NextSSL(root=True)   # tier 'unverified' is reachable from the root API only
block = root.call("blockcipher_encrypt", "square", None, key, plaintext_block)[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Similar names

Looking for something else?

Frequently asked questions

What is Square?

Square is a block cipher in the Square family. Square is a 128-bit block cipher with a 128-bit key, proposed in 1997 by Joan Daemen, Lars Knudsen and Vincent Rijmen.

What are the Square sizes?

In NextSSL, Square uses: key 16 bytes, block 16 bytes.

Who designed Square and when?

Square belongs to the Square family, first published in 1997 by Joan Daemen, Lars Knudsen, Vincent Rijmen. Its origin: Proposed in 1997.

Which standards define Square?

Square is referenced by Square (Daemen, Knudsen, Rijmen, 1997), Crypto++ implementation.

Is Square safe to use?

Square is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).