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 uses the same key for both encryption and decryption. KMS securely stores the key material to prevent unauthorized access, ensuring the confidentiality of your encrypted data.
Key specifications
The following table lists the key specifications supported by each key management type for symmetric keys.
-
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 |
|
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 |
|
GCM (default), ECB, CBC |
ENCRYPT/DECRYPT |
|
|
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 |
||
|
External key |
Aliyun_AES_256 |
GCM (default), ECB, CBC |
ENCRYPT/DECRYPT |
|
Technical standards
-
Aliyun_AES_256: AES key, 256 bits. Complies with the technical standard "Advanced Encryption Standard (AES)" (FIPS PUB 197).
-
Aliyun_AES_192: AES key, 192 bits. Complies with the technical standard "Advanced Encryption Standard (AES)" (FIPS PUB 197).
-
Aliyun_AES_128: AES key, 128 bits. Complies with the technical standard "Advanced Encryption Standard (AES)" (FIPS PUB 197).
-
HMAC_224: HMAC key using the SHA-224 hash algorithm with a 224-bit MAC output. Complies with the technical standard "The Keyed-Hash Message Authentication Code (HMAC)" (FIPS 198-1).
-
HMAC_256: HMAC key using the SHA-256 hash algorithm with a 256-bit MAC output. Complies with the technical standard "The Keyed-Hash Message Authentication Code (HMAC)" (FIPS 198-1).
-
HMAC_384: HMAC key using the SHA-384 hash algorithm with a 384-bit MAC output. Complies with the technical standard "The Keyed-Hash Message Authentication Code (HMAC)" (FIPS 198-1).
-
HMAC_512: HMAC key using the SHA-512 hash algorithm with a 512-bit MAC output. Complies with the technical standard "The Keyed-Hash Message Authentication Code (HMAC)" (FIPS 198-1).
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.
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.
-
ENCRYPT/DECRYPT: Use the public key to encrypt data through the Encrypt operation, and the private key to decrypt data through the Decrypt operation.
-
SIGN/VERIFY: Use the private key to compute digital signatures through the Sign operation, and the public key to verify signatures through the Verify operation.
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) |
|
|
Ed25519 |
Not supported |
EdDSA |
|
|
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) |
Technical standards
-
RSA_2048: RSA key pair with a modulus length of 2048 bits. Complies with the technical standard "PKCS #1: RSA Cryptography Specifications Version 2.2".
-
RSA_3072: RSA key pair with a modulus length of 3072 bits. Complies with the technical standard "PKCS #1: RSA Cryptography Specifications Version 2.2".
-
RSA_4096: RSA key pair with a modulus length of 4096 bits. Complies with the technical standard "PKCS #1: RSA Cryptography Specifications Version 2.2".
-
EC_P256: Elliptic Curve Cryptography (ECC) key pair using the P-256 curve recommended by NIST, also known as secp256r1 or ANSI prime256v1 in other standards. Complies with the technical standard "NIST SP800-186 Recommendations for Discrete Logarithm-based Cryptography".
-
EC_P256K: Elliptic Curve Cryptography (ECC) key pair using the secp256k1 curve recommended by SECG. Complies with the technical standard "SEC 2: Recommended Elliptic Curve Domain Parameters".
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.
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.