Skip to content

Commit 09f89ea

Browse files
Adding workflow
1 parent 8f40a15 commit 09f89ea

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/utilities/data_masking.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,39 @@ sequenceDiagram
504504
<i>Encrypting operation using envelope encryption.</i>
505505
</center>
506506

507+
#### Encrypt operation with multiple KMS Keys
508+
509+
When encrypting data with multiple KMS keys, the `aws_encryption_sdk` executes additional encryption calls to encrypt the data with each of the specified keys.
510+
511+
<center>
512+
```mermaid
513+
sequenceDiagram
514+
autonumber
515+
participant Client
516+
participant Lambda
517+
participant DataMasking as Data Masking
518+
participant EncryptionProvider as Encryption Provider
519+
Client->>Lambda: Invoke (event)
520+
Lambda->>DataMasking: Init Encryption Provider with master key
521+
Note over Lambda,DataMasking: AWSEncryptionSDKProvider([KMS_KEY])
522+
Lambda->>DataMasking: encrypt(data)
523+
DataMasking->>EncryptionProvider: Create unique data key
524+
Note over DataMasking,EncryptionProvider: KMS GenerateDataKey API
525+
DataMasking->>DataMasking: Cache new unique data key
526+
DataMasking->>DataMasking: DATA_KEY.encrypt(data)
527+
DataMasking->>DataMasking: MASTER_KEY.encrypt(DATA_KEY)
528+
DataMasking->>DataMasking: Create encrypted message
529+
alt Using another KMS key?
530+
DataMasking->>EncryptionProvider: Encrypt data
531+
Note over DataMasking,EncryptionProvider: KMS Encrypt API
532+
end
533+
Note over DataMasking: Encrypted message includes encrypted data, data key encrypted, algorithm, and more.
534+
DataMasking->>Lambda: Ciphertext from encrypted message
535+
Lambda-->>Client: Return response
536+
```
537+
<i>Encrypting operation using envelope encryption.</i>
538+
</center>
539+
507540
#### Decrypt operation with Encryption SDK (KMS)
508541

509542
We call KMS to decrypt the encrypted data key available in the encrypted message. If successful, we run authentication _(context)_ and integrity checks (_algorithm, data key length, etc_) to confirm its proceedings.

0 commit comments

Comments
 (0)