SM4DecryptECB

Cryptography

Description

Decrypts a ciphertext with SM4 in ECB mode under a 16-byte key

Syntax

Delphi

Function SM4DecryptECB(Const Key, Ciphertext: AnsiString): AnsiString;

Parameters

KeyExactly 16 bytes
CiphertextLength must be a multiple of 16

Return values

The decrypted plaintext, or an empty string on any invalid input

Remarks

Part of the pure-Pascal SM4 block cipher (GB/T 32907-2016); the implementation passes the standard single-block vector, the published first round key and the one-million-iteration vector

The payload length must be a multiple of 16; there is no padding layer

See also

SM4EncryptECB, SM4DecryptCBC, PLSM4DecryptBlock, PLSM4InitKey