Home

SM4

SM4 is a symmetric-key block cipher designed in China for general-purpose encryption. It was standardized as GB/T 32918-2016 and is part of the country’s family of domestic cryptographic algorithms known as the SM (ShangMi) series. The cipher is widely referenced in Chinese security standards and implementations for government, industry, and consumer applications.

Technically, SM4 operates on 128-bit blocks and uses a 128-bit key. The algorithm performs 32 rounds of

Security and evaluation of SM4 are aligned with contemporary block ciphers: no practical cryptanalytic break is

Implementation and usage of SM4 are widespread in China, appearing in numerous standards, protocols, and software

See also: SM2, SM3, SM4 in Chinese encryption standards.

processing.
Each
round
applies
a
nonlinear
substitution
using
an
8-bit
S-box,
followed
by
a
linear
diffusion
transformation.
A
key
schedule
expands
the
128-bit
key
into
32
32-bit
round
keys
using
a
fixed
set
of
constants.
Encryption
and
decryption
share
the
same
round
structure;
decryption
uses
the
round
keys
in
reverse
order.
known
that
would
compromise
128-bit
security
under
standard
models.
Research
has
explored
reduced-round
variants
and
related-key
scenarios,
but
these
do
not
translate
into
practical
attacks
on
the
full
32-round
cipher.
As
with
any
cipher,
proper
implementation
is
important
to
avoid
side-channel
weaknesses;
constant-time
code
and
resistance
to
timing
and
cache-based
attacks
are
commonly
recommended.
libraries.
It
is
available
in
reference
implementations
and
optimized
versions
for
various
platforms,
including
support
for
modes
such
as
SM4-GCM
and
SM4-CTR
in
modern
cryptographic
stacks.
SM4
remains
the
primary
Chinese
block
cipher
for
domestic
encryption
needs
and
interoperability
within
national
standards.