Square
Daemen, Knudsen and Rijmen's 1997 128-bit substitution-permutation cipher, a precursor to Rijndael
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–1997Square published by Joan Daemen, Lars Knudsen, Vincent Rijmen
How it works
- The 128-bit key is expanded into round keys.
- Each round applies a byte-wise substitution layer, a byte permutation and a linear mixing layer over the block.
- 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
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| key | 16 | Secret key |
| block | 16 | Block |
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]
nextssl_root_blockcipher_encrypt("square", NULL, key, block, out); /* exactly one block */
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_blockcipher_in(reg::all(), Policy::Any, "square", &Params::new())?;
let out = alg.encrypt_block(&key, &block)?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Similar names
Looking for something else?More block ciphers
All 84Frequently 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).
Related families
A 1993 Daemen block cipher with a 96-bit block and 96-bit key, kept for historical comparison
AESThe Advanced Encryption Standard: the world's default 128-bit block cipher
MARSIBM's 128-bit block AES finalist, with a variable-length key and the 1999 key-setup tweak
SerpentThe conservative AES finalist with 32 rounds of bit-sliced 4-bit S-boxes
SHARKA 1996 substitution-permutation block cipher by Rijmen, Daemen and colleagues, carried at six rounds