SM4 (cipher) explained

SM4
Designers:Data Assurance & Communication Security Center, Chinese Academy of Sciences
Publish Date:2006 (declassified; standardized March 21, 2012)[1]
Key Size:128 bits
Block Size:128 bits
Structure:unbalanced Feistel network
Rounds:32
Cryptanalysis:Linear and differential attacks against 22 rounds

ShāngMì 4 (SM4, 商密4) (formerly SMS4)[2] is a block cipher used in the Chinese National Standard for Wireless LAN WAPI (WLAN Authentication and Privacy Infrastructure) and also used with Transport Layer Security.[3]

SM4 was a cipher proposed for the IEEE 802.11i standard, but it has so far been rejected. One of the reasons for the rejection has been opposition to the WAPI fast-track proposal by the IEEE.

SM4 was published as in 2021.

The SM4 algorithm was drafted by Data Assurance & Communication Security Center, Chinese Academy of Sciences (CAS), and Commercial Cryptography Testing Center, National Cryptography Administration. It is mainly developed by Lü Shuwang (Chinese: 吕述望). The algorithm was declassified in January, 2006, and it became a national standard (GB/T 32907-2016) in August 2016.[4]

Cipher detail

The SM4 cipher has a key size and a block size of 128 bits each.[5] [6] Encryption or decryption of one block of data is composed of 32 rounds. A non-linear key schedule 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

MK=(MK0,MK1,MK2,MK3)

, in which

MKi(i=0, 1, 2, 3)

is a 32-bit word. The round keys are represented by

(rk0,rk1,\ldots,rk31)

, where each

rki(i=0,\ldots, 31)

is a word. It is generated by the encryption key and the following parameters:

FK=(FK0,FK1,FK2,FK3)

CK=(CK0,CK1,\ldots,CK31)

FKi

and

CKi

are words, used to generate the round keys.

Round

Each round are computed from the four previous round outputs

Xi,Xi+1,Xi+2,Xi+3

such that:

Xi+4=XiF(Xi+1Xi+2Xi+3rki)

Where

F

is a substitution function composed of a non-linear transform, the S-box and linear transform

L

S-box

S-box is fixed for 8-bit input and 8-bit output, noted as Sbox. As with Advanced Encryption Standard (AES), the S-box is based on the multiplicative inverse 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 S-Box.[7]

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. It contains a reference implementation in ANSI C.[8]

SM4 is part of the ARMv8.4-A expansion to the ARM architecture.[9]

SM4 support for the RISC-V architecture was ratified in 2021 as the Zksed extension.[10]

SM4 is supported by Intel processors, from Arrow Lake S, Lunar Lake and Clearwater Forest.

External links

Notes and References

  1. Web site: SM4 Block Cipher Algorithm . . 2013-12-04 . 2016-07-24 . 2016-09-19 . https://web.archive.org/web/20160919072646/http://www.cnnic.cn/gcjsyj/qyjsyj/mmsfbz/sm4/201312/t20131204_43341.htm . dead .
  2. Web site: Announcement No.23 of the State Cryptography Administration . The Office of Security Commercial Code Administration (OSCCA) . 2012-03-21 . 2016-07-24 . dead . https://web.archive.org/web/20160814151056/http://www.oscca.gov.cn/News/201204/News_1228.htm . 2016-08-14 . zh-cn.
  3. 8998 . Yang . P . March 2021 . . 2022-07-30 . 10.17487/RFC8998.
  4. Lu Shuwang. [J]. Journal of Information Security Research, 2016, 2(11): 995-1007.
  5. http://www.oscca.gov.cn/UpFile/200621016423197990.pdf 无线局域网产品使用的SMS4密码算法
  6. http://eprint.iacr.org/2008/329.pdf SMS4 Encryption Algorithm for Wireless Networks
  7. Web site: Saarinen . Markku-Juhani O. . mjosaarinen/sm4ni: Demonstration that AES-NI instructions can be used to implement the Chinese Encryption Standard SM4 . GitHub . 17 April 2020.
  8. Tse . Ronald . Kit . Wong . Saarinen . Markku-Juhani . The SM4 Blockcipher Algorithm And Its Modes Of Operations . tools.ietf.org . 22 April 2018 . en.
  9. Web site: Introducing 2017's extensions to the Arm Architecture . community.arm.com . 2 November 2017 . en.
  10. Web site: RISC-V Cryptography Extensions Task Group Announces Public Review of the Scalar Cryptography Extensions . riscv.org . en.