You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/key-manager/api-cli/encrypt-decrypt-data-with-km-dek.mdx
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,20 +132,21 @@ To encrypt your data using OpenSSl, you need to:
132
132
133
133
3. Encrypt the content of `plaintext.txt` using OpenSSL and the `AES-256-CBC` cipher encryption algorithm.
134
134
135
-
Open a terminal and paste the following command to perform the actions described above. Make sure that you replace `<kek_id>` and `<my_encrypted_data_key>` with the relevant values.
4. Open a terminal and paste the following command to perform the actions described above. Make sure that you replace `<kek_id>` and `<my_encrypted_data_key>` with the relevant values.
@@ -155,14 +156,14 @@ To decrypt your encrypted data using OpenSSL, you need to:
155
156
156
157
2. Decrypt the content of `encrypted.bin` which contains your encrypted data, using OpenSSL and the `AES-256-CBC` cipher encryption algorithm.
157
158
158
-
Open a terminal and paste the following command to perform the actions described above. Make sure that you replace `<kek_id>` and `<my_encrypted_data_key>` with the relevant values.
3. Open a terminal and paste the following command to perform the actions described above. Make sure that you replace `<kek_id>` and `<my_encrypted_data_key>` with the relevant values.
If you do not wish to use OpenSSL to encrypt and decrypt your data encryption key, you can do it manually using the procedure below, which follows best practices.
Copy file name to clipboardExpand all lines: pages/key-manager/api-cli/manage-keys-with-tink.mdx
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,22 +25,23 @@ This documentation page provides information on Key Manager Key Encryption Keys
25
25
26
26
## Encrypting and decrypting data with Tink
27
27
28
-
Paste the following code into a `.go` file. This template contains the data we will encrypt (`"Hello, World!"`), and the code to encrypt and decrypt it.
28
+
Paste the following code into a `.go` file. This template contains an example of data we will encrypt (`"Hello, World!"`), and the code to encrypt and decrypt it.
29
+
29
30
```go
30
-
associatedData := []byte("") // Read the ## Associated data section for more information
31
-
secretData := []byte("Hello, World!") // Data we want to encrypt
31
+
associatedData:= []byte("") //Refer to the the ##Associated data section below for more information
32
+
secretData:= []byte("Hello, World!") //Defines secretData as the plaintext message ("Hello, World!") we want to encrypt
32
33
33
-
ciphertext, _ := kekAEAD.Encrypt(secretData, associatedData) // Encrypt the data
34
-
fmt.Println(ciphertext) // Print the encrypted data
34
+
ciphertext, _:= kekAEAD.Encrypt(secretData, associatedData) //Encrypts the data, the result is stored in ciphertext
35
+
fmt.Println(ciphertext) //Prints the encrypted data ("Hello, World!" as unreadable bytes)
plaintext, _:= kekAEAD.Decrypt([]byte(ciphertext), associatedData)// Decrypts the data, turning the ciphertext back into the original secretData
38
+
fmt.Println(string(plaintext)) //Converts the decrypted unreadable bytes back to a string and prints "Hello, World!"
38
39
```
39
40
40
41
<Messagetype="important">
41
42
While the code shown above functions as intended, this is not a recommended pattern, and the following limitations apply:
42
43
- It is slow: since the key resides on Scaleway Key Manager, each encryption or decryption operation translates into a remote API call.
43
-
- The payload to encrypt is limited in size: Key Manager only allows up to 64 KiB. As a result, you will not be able to encrypt larger payloads with `kekAEAD`.
44
+
- The payload to encrypt is limited in size: Key Manager only allows up to 64 KB. As a result, you will not be able to encrypt larger payloads with `kekAEAD`.
44
45
- You cannot choose the cipher and the algorithm that suit your use case, Key Manager handles that on your behalf.
Copy file name to clipboardExpand all lines: pages/key-manager/api-cli/rotate-keys-api-cli.mdx
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
---
2
2
meta:
3
-
title: Perform key rotation using the Scaleway CLI and API
4
-
description: Learn why key rotation enhances security and how to configure automated or manual key rotation in Scaleway's Key Manager.
3
+
title: Rotate keys using the Scaleway CLI and API
4
+
description: Learn why key rotation enhances security and how to configure automated or manual key rotation in Scaleway's Key Manager.
5
5
content:
6
-
h1: Perform key rotation using the Scaleway CLI and API
7
-
paragraph: Learn why key rotation enhances security and how to configure automated or manual key rotation in Scaleway's Key Manager.
8
-
tags: key sensitive-data rotation
6
+
h1: Rotate keys using the Scaleway CLI and API
7
+
paragraph: Learn why key rotation enhances security and how to configure automated or manual key rotation in Scaleway's Key Manager.
8
+
tags: key sensitive-data rotation versioning
9
9
dates:
10
10
validation: 2025-02-03
11
11
posted: 2025-02-03
12
12
---
13
13
14
-
Key rotation is a critical security practice that ensures that encryption keys are not reused for extended periods of time. Regularly rotating keys helps limit the number of messages encrypted with the same key version.
14
+
[Key rotation](/key-manager/concepts/#key-rotation) is a critical security practice that ensures that encryption keys are not reused for extended periods of time. Regularly rotating keys helps limit the number of messages encrypted with the same key version.
15
15
16
16
This reduces the risk of exposure if a key is compromised, thus enhancing the overall security and resilience of your system. For symmetric encryption, it is generally recommended to rotate keys every 30 to 90 days.
17
17
@@ -69,7 +69,7 @@ Copy the following command to configure automatic rotation when creating a key:
69
69
-**rotation_period:** duration between two key rotations (min: 24 hours, max: 100 years).
70
70
-**next_rotation_at:** date at which the key will be rotated next.
71
71
72
-
To configure automatic rotation on an existing key, use the `UpdateKey` endpoint as follows:
72
+
To configure automatic rotation on an existing key, use the `UpdateKey`[endpoint](https://www.scaleway.com/en/developers/api/key-manager/#path-keys-update-a-key) as follows:
@@ -85,7 +85,7 @@ To configure automatic rotation on an existing key, use the `UpdateKey` endpoint
85
85
86
86
## Manually rotate your key
87
87
88
-
To rotate your key manually, you can use the `RotateKey` endpoint as follows:
88
+
To rotate your key manually, you can use the `RotateKey`[endpoint](https://www.scaleway.com/en/developers/api/key-manager/#path-keys-rotate-a-key) as follows:
89
89
90
90
```
91
91
curl -X POST 'https://api.scaleway.com/key-manager/v1alpha1/regions/fr-par/keys/<your_key_id>/rotate' \
Copy file name to clipboardExpand all lines: pages/key-manager/concepts.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,13 +45,13 @@ A data encryption key is a type of key that can be used outside Key Manager to e
45
45
46
46
Key Manager generates DEKs on-demand. They are then encrypted by a [key encryption key](#key-encryption-key-kek) specified by the user, and forwarded to the recipient.
47
47
48
-
DEKs are **not stored in or managed by Key Manager**. Users are responsible for safely storing and managing DEKs. DEKs should have the same lifecycle as the [payload](#payload) they encrypt**.
48
+
DEKs are **not stored in or managed by Key Manager**. Users are responsible for safely storing and managing DEKs. DEKs should have the same lifecycle as the [payload](#payload) they encrypt.
49
49
50
50
## Decryption
51
51
52
52
A cryptographic operation used to convert [ciphertext](#ciphertext) back into its original [plaintext](#plaintext) form, using a key encryption key.
53
53
54
-
The only way to decrypt an encrypted payload is by using the `Decrypt`[endpoint](https://www.scaleway.com/en/developers/api/key-manager/V1/#path-keys-decrypt-keys). Since key versions never leave Key Manager, there is no other way to decrypt data outside Key Manager.** A payload encrypted with an older key version can still be decrypted. In this case, for convenience, the payload encrypted with the latest key version will be returned, along with the decrypted payload.
54
+
The only way to decrypt an encrypted payload is by using the `Decrypt`[endpoint](https://www.scaleway.com/en/developers/api/key-manager/V1/#path-keys-decrypt-data). Since key versions never leave Key Manager, there is no other way to decrypt data outside Key Manager. A payload encrypted with an older key version can still be decrypted. In this case, for convenience, the payload encrypted with the latest key version will be returned, along with the decrypted payload.
0 commit comments