ShāngMì 4 (SM4, 商密4) (formerly SMS4)
is a
block cipher
In cryptography, a block cipher is a deterministic algorithm operating on fixed-length groups of bits, called ''blocks''. Block ciphers are specified cryptographic primitive, elementary components in the design of many cryptographic protocols and ...
used in the
Chinese
Chinese can refer to:
* Something related to China
* Chinese people, people of Chinese nationality, citizenship, and/or ethnicity
**''Zhonghua minzu'', the supra-ethnic concept of the Chinese nation
** List of ethnic groups in China, people of ...
National Standard for Wireless LAN
WAPI (WLAN Authentication and Privacy Infrastructure) and also used with
Transport Layer Security
Transport Layer Security (TLS) is a cryptographic protocol designed to provide communications security over a computer network. The protocol is widely used in applications such as email, instant messaging, and voice over IP, but its use in securi ...
.
SM4 was a cipher proposed to for the
IEEE 802.11i standard, but has so far been rejected by
ISO
ISO is the most common abbreviation for the International Organization for Standardization.
ISO or Iso may also refer to: Business and finance
* Iso (supermarket), a chain of Danish supermarkets incorporated into the SuperBest chain in 2007
* Iso ...
. One of the reasons for the rejection has been opposition to the WAPI fast-track proposal by the
IEEE
The Institute of Electrical and Electronics Engineers (IEEE) is a 501(c)(3) professional association for electronic engineering and electrical engineering (and associated disciplines) with its corporate office in New York City and its operation ...
.
The SM4 algorithm was drafted by Data Assurance & Communication Security Center, CAS, and Commercial Cryptography Testing Center, National Cryptography Administration. It is mainly developed by Lü Shuwang ( zh, 吕述望). The algorithm was declassified in January, 2006, and it became a national standard (GB/T 32907-2016) in August 2016.
[Lu Shuwang. Journal of Information Security Research, 2016, 2(11): 995-1007.]
Cipher detail
The SM4 cipher has a key size and a block size of 128 bits each. Encryption or decryption of one block of data is composed of 32 rounds. A non-linear
key schedule
In cryptography, the so-called product ciphers are a certain kind of cipher, where the (de-)ciphering of data is typically done as an iteration of ''rounds''. The setup for each round is generally the same, except for round-specific fixed valu ...
is used to produce the round keys and the decryption uses the same round keys as for encryption, except that they are in reversed order.
Keys and key parameters
The length of encryption keys is 128 bits, represented as
, in which
is a 32-bit word. The round keys are represented by
, where each
is a word. It is generated by the encryption key and the following parameters:
*
*
and
are words, used to generate the round keys.
Round
Each round are computed from the four previous round outputs
such that:
Where
is a substitution function composed of a non-linear transform, the S-box and linear transform
S-box
S-box is fixed for 8-bit input and 8-bit output, noted as Sbox(). As with
AES, the S-box is based on the
multiplicative inverse
In mathematics, a multiplicative inverse or reciprocal for a number ''x'', denoted by 1/''x'' or ''x''−1, is a number which when Multiplication, multiplied by ''x'' yields the multiplicative identity, 1. The multiplicative inverse of a rat ...
over . The affine transforms and polynomial bases are different from that of AES, but due to
affine isomorphism it can be calculated efficiently given an AES
Rijndael S-box
The Rijndael S-box is a substitution box (lookup table) used in the Rijndael cipher, on which the Advanced Encryption Standard (AES) cryptographic algorithm is based.
Forward S-box
The S-box maps an 8-bit input, , to an 8-bit output, . Both the ...
.
Remark
On March 21, 2012, the Chinese government published the industrial standard "GM/T 0002-2012 SM4 Block Cipher Algorithm", officially renaming SMS4 to SM4.
A description of SM4 in English is available as an
Internet Draft
An Internet Draft (I-D) is a document published by the Internet Engineering Task Force (IETF) containing preliminary technical specifications, results of networking-related research, or other technical information. Often, Internet Drafts are int ...
. It contains a reference implementation in
ANSI C
ANSI C, ISO C, and Standard C are successive standards for the C programming language published by the American National Standards Institute (ANSI) and ISO/IEC JTC 1/SC 22/WG 14 of the International Organization for Standardization (ISO) and the ...
.
SM4 is part of the ARMv8.4-A expansion to the
ARM architecture
ARM (stylised in lowercase as arm, formerly an acronym for Advanced RISC Machines and originally Acorn RISC Machine) is a family of reduced instruction set computer (RISC) instruction set architectures for computer processors, configured ...
.
References
External links
Linear and Differential Cryptanalysis of Reduced SMS4 Block CipherThe GmSSL Project(OpenSSL fork with GuoMi algorithms)
{{Cryptography navbox , block
Block ciphers
Standards of the People's Republic of China