| name | encryption-pattern |
| description | Security pattern for implementing encryption and decryption operations. Use when encrypting data for confidentiality, selecting encryption algorithms (AES, RSA), configuring cipher modes (GCM, CBC), choosing key lengths, or implementing symmetric/asymmetric encryption. Specialization of Cryptographic action pattern addressing confidentiality requirements. |
Encryption Security Pattern
Encrypt a message (data elements and/or action requests) to ensure its confidentiality with respect to entities that do not possess the correct decryption key.
Core Components
| Role | Type | Responsibility |
|---|
| EntityA | Entity | Wants to encrypt one or more data elements and/or action requests |
| EntityB | Entity | Wants to decrypt received ciphertext (may be same as EntityA) |
| Encrypter | Cryptographic Primitive | Library providing encryption action |
| Decrypter | Cryptographic Primitive | Library providing decryption action |
Note: Encrypter and Decrypter roles can be performed by a single library instance. Similarly, EntityA and EntityB can be the same entity.
Data Elements
- plaintext: Original data to be encrypted
- ciphertext: Encrypted data {plaintext}_k
- keyInfo: Information on cryptographic key (identifier or key material)
- config: Cipher configuration (algorithm, mode, parameters) - optional
Actions
- encrypt: Request to encrypt plaintext using identified key and configuration