Key management types and key specifications

Updated at:

In scenarios such as data encryption and digital signatures, you can select an appropriate key management type and key specification based on compliance requirements (such as national cryptography compliance), performance needs, or security levels. After you purchase the national cryptography software module, software-protected keys support the Aliyun_SM4 specification. This topic describes the key specifications supported by each key management type.

Supported symmetric key specifications

Symmetric key encryption is one of the most common methods to protect sensitive data. The same key material is used for both encryption and decryption. KMS securely stores the key material of symmetric keys to prevent unauthorized theft or use, which ensures the security of encrypted data.

Key specifications

The following table lists the key specifications supported by each key management type for symmetric keys.

Note
  • When you call the CreateKey operation to create a key without specifying KeySpec, KMS creates a symmetric key with the Aliyun_AES_256 specification by default.

  • HMAC keys require KMS instance version 4.1.0 or later. Otherwise, the console prompts you to upgrade the instance image. HMAC keys do not support automatic key rotation.

Key management type

Key specification

Supported encryption algorithm

Supported key usage

Padding mode

Default key

Aliyun_AES_256

GCM (default)

ENCRYPT/DECRYPT

N/A

Software-protected key

Aliyun_AES_256

GCM (default)

ENCRYPT/DECRYPT

N/A

Aliyun_SM4

Note

This specification requires the national cryptography module.

GCM (default)

ENCRYPT/DECRYPT

N/A

HMAC_224

HMAC_SHA_224

SIGN/VERIFY

N/A

HMAC_256

HMAC_SHA_256

SIGN/VERIFY

HMAC_384

HMAC_SHA_384

SIGN/VERIFY

HMAC_512

HMAC_SHA_512

SIGN/VERIFY

Hardware-protected key

  • Aliyun_AES_256

  • Aliyun_AES_192

  • Aliyun_AES_128

GCM (default), ECB, CBC

ENCRYPT/DECRYPT

  • When the encryption mode is GCM: no padding mode is involved.

  • When the encryption mode is ECB/CBC: the padding mode is PKCS7_PADDING or NO_PADDING.

Aliyun_SM4

GCM (default)

ENCRYPT/DECRYPT

N/A

HMAC_SM3

HMAC_SM3

SIGN/VERIFY

HMAC_256

HMAC_SHA_256

SIGN/VERIFY

External key

Aliyun_AES_256

GCM (default), ECB, CBC

ENCRYPT/DECRYPT

  • When the encryption mode is GCM: no padding mode is involved.

  • When the encryption mode is ECB/CBC: the padding mode is PKCS7_PADDING or NO_PADDING.

Aliyun_SM4

GCM (default)

ENCRYPT/DECRYPT

N/A

Technical standards

Supported asymmetric key specifications

An asymmetric key consists of a cryptographically related public key and private key pair. The public key can be freely distributed, while the private key must remain securely protected and accessible only to the owner or trusted parties.

Note

For asymmetric keys created in KMS, the public key can be obtained through the GetPublicKey operation or the KMS console. KMS ensures the security of private keys and does not provide any operation to export them.

Asymmetric keys are typically used for digital signature verification or for encrypting and distributing small amounts of data such as symmetric keys. Set the key usage when you create an asymmetric key.

  • When the key usage is ENCRYPT/DECRYPT, you can call the Encrypt operation of KMS to encrypt data by using the public key, and call the Decrypt operation to decrypt data by using the private key.

  • When the key usage is SIGN/VERIFY, you can call the Sign operation of KMS to compute digital signatures by using the private key, and call the Verify operation to verify signatures by using the public key.

Note

Due to the high computational cost of asymmetric cryptographic operations, use asymmetric keys only for small data blocks such as securely distributing symmetric keys.

Key specifications

The following table lists the key specifications supported by each key management type for asymmetric keys.

Key management type

Key specification

Supported encryption algorithm

Supported signature algorithm

Software-protected key

RSA_2048, RSA_3072, RSA_4096

RSAES_OAEP_SHA_256 (default)

RSA_PSS_SHA_256 (default), RSA_PKCS1_SHA_256

EC_P256, EC_P256K

ECIES_DH_SHA_1_XOR_HMAC (default)

ECDSA_SHA_256 (default)

ML_DSA_44, ML_DSA_65, ML_DSA_87

Note

This specification requires the post-quantum module, and the instance version must be dkms-4.6.0 or later.

Not supported

ML_DSA_SHAKE_256

Hardware-protected key

RSA_2048, RSA_3072, RSA_4096

RSAES_OAEP_SHA_256 (default)

RSA_PSS_SHA_256 (default), RSA_PKCS1_SHA_256

EC_P256, EC_P256K

ECIES_DH_SHA_1_XOR_HMAC (default)

ECDSA_SHA_256 (default)

EC_SM2

SM2PKE (default)

SM2DSA (default)

ML_DSA_44, ML_DSA_65, ML_DSA_87

Note

This specification requires the post-quantum module. You must also contact Alibaba Cloud engineers to upgrade the instance image and the HSM firmware.

Not supported

ML_DSA_SHAKE_256

Technical standards

Encryption algorithms

  • RSAES_OAEP_SHA_256: RSA encryption using the RSAES-OAEP mode as defined in RFC 3447/PKCS#1, with MGF1 and SHA-256.

  • ECIES_DH_SHA_1_XOR_HMAC: Complies with the SEC 1: Elliptic Curve Cryptography, Version 2.0 standard. Uses ECDH for key agreement, KDF2 with SHA-1 for key derivation, HMAC-SHA-1 as the MAC algorithm, and XOR for symmetric encryption.

  • SM2PKE: SM2 elliptic curve public key encryption algorithm, compliant with the standard "GM/T 0003.4 SM2 Elliptic Curve Public Key Cryptography Algorithm Part 4: Public Key Encryption Algorithm".

Signature algorithms

  • RSA_PSS_SHA_256: Computes the SHA-256 hash of the data and the signature using the RSASSA-PSS algorithm as defined in RFC 3447/PKCS#1, with MGF1 (SHA-256).

  • RSA_PKCS1_SHA_256: Computes the SHA-256 hash of the data and the signature using the RSASSA-PKCS1-v1_5 algorithm as defined in RFC 3447/PKCS#1.

  • ECDSA_SHA_256: ECDSA digital signature using the SHA-256 hash algorithm.

  • SM2DSA: SM2 elliptic curve digital signature algorithm, compliant with the standard "GM/T 0003.2 SM2 Elliptic Curve Public Key Cryptography Algorithm Part 2: Digital Signature Algorithm".

  • ML_DSA_SHAKE_256: ML-DSA digital signature that uses the SHAKE256 algorithm to compute the message digest, compliant with the standard "Module-Lattice-Based Digital Signature Standard" (FIPS 204).