Skip to content

Commit 91b9d86

Browse files
committed
Updated algs for key wrapping. Add AES-CBC
Signed-off-by: ItalyPaleAle <[email protected]>
1 parent 34da83f commit 91b9d86

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

0002-RCBS-Crypto-building-block.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ Each message is encrypted with a 256-bit symmetric **File Key (FK)** that is ran
8686
The FK is wrapped using a key stored in a key vault (**Key Encryption Key (KEK)**) by Dapr. The result of the wrapping operation is the **Wrapped File Key (WFK)**. The algorithm used depends on the type of the KEK as well as the algorithms supported by the component: in order of preference:
8787

8888
- For symmetric keys:
89-
- AES-KW with 256-bit keys ([RFC 3394](https://www.rfc-editor.org/rfc/rfc3394.html)): `AES-256-KW`
90-
- Because the File Key is 256-bit long, only 256-bit wrapping keys can be used (i.e. `AES-256-KW`).
89+
- AES-KW with 256-bit keys ([RFC 3394](https://www.rfc-editor.org/rfc/rfc3394.html)): `A256KW`
90+
- Because the File Key is 256-bit long, only 256-bit wrapping keys can be used
91+
- AES-CBC with keys 128-bit, 192-bit, and 256-bit: `A128CBC-NOPAD`, `A192CBC-NOPAD`, `A256CBC-NOPAD`
92+
- These don't use PKCS#7 padding because the File Key is 256-bit so it's a multiple of the AES block size.
9193
- For RSA keys:
9294
- RSA OAEP with SHA-256: `RSA-OAEP-256`
9395
- Dapr doesn't impose limitations on the size of the key, and any key bigger than 1024 bits should work; however, 4096-bit keys are strongly recommended.
@@ -131,8 +133,11 @@ type Manifest struct {
131133
// This is optional, and if specified can be in the format `key` or `key/version`.
132134
KeyName string `json:"k,omitempty"`
133135
// ID of the wrapping algorithm used.
134-
// 0x01 = AES-256-KW
135-
// 0x02 = RSA-OAEP-256
136+
// 0x01 = A256KW
137+
// 0x02 = A128CBC-NOPAD
138+
// 0x03 = A192CBC-NOPAD
139+
// 0x04 = A256CBC-NOPAD
140+
// 0x05 = RSA-OAEP-256
136141
KeyWrappingAlgorithm int `json:"kw"`
137142
// The Wrapped File Key
138143
WFK []byte `json:"wfk"`

0 commit comments

Comments
 (0)