Symmetric key in KMS
A symmetric key is a set of versions, each of which defines an algorithm and cryptographic material for data encryption or decryption operations.
A symmetric key is created along with its first version that becomes the primary one. It is used by default in key operations unless you specify a different version in the input parameters.
When rotating keys, the parameters of new versions are inherited from the key parameters.
You can change the primary version of the symmetric key at any time by specifying any previous version. For additional security of your data, rotate keys on a regular basis and only use previous versions to decrypt data. This limits the lifetime of cryptographic material.
Key parameters
A KMS symmetric key may have the following parameters:
-
ID: Unique key ID in Yandex Cloud. It is used for managing keys via the SDK, API, and CLI.
-
Name: Non-unique key name. It can be used to manage keys in the CLI if the folder only contains one key with this name.
-
Encryption algorithm: Algorithm used to modify data using a key. The following algorithms are supported:
AES-128: AES algorithm with 128-bit keys in GCM mode.AES-192: AES algorithm with 192-bit keys in GCM mode.AES-256: AES algorithm with 256-bit keys in GCM mode.AES-256 HSM: AES algorithm with 256-bit keys in CBC mode with HMAC . Encryption keys are created and cryptographic operations handled in a Hardware Security Module (HSM).GOST_R_3412_2015_K: Grasshopper algorithm with OMAC , GOST -compliant.
-
Rotation period: Time span between automatic key rotations.
-
Deletion protection: Pprevents accidental key deletion. When enabled, you cannot delete the key without disabling this option first.
-
Status: Current state of the key. The following statuses are possible:
Creating: Key is being created.Active: Key can be used for encryption and decryption.Inactive: Key cannot be used.
You can change the key status from
ActivetoInactiveand vice versa using the update method.
Using a symmetric key
You can use a symmetric key in data encryption and decryption operations if you have the appropriate roles assigned. For more information, see Access management in Key Management Service.
Also, you can temporarily disable operations with a key by revoking roles or changing its status to Inactive.
Deleting a key
If you delete a key or its parent resource (folder or cloud), this destroys the cryptographic material contained in it. After that, you will not be able to decrypt the data encrypted with that key.
Use cases
- Encrypting data using the Yandex Cloud CLI and API
- Encrypting data using the Yandex Cloud SDK
- Encrypting data using the AWS Encryption SDK
- Encrypting data using Google Tink
- Encrypting secrets in Yandex Managed Service for Kubernetes
- Managing KMS keys with Hashicorp Terraform
- Encrypting secrets in Hashicorp Terraform
- Auto Unseal in Hashicorp Vault
- Secure password transmission to an initialization script