aws_encryption_sdk.internal.crypto.encryption
Contains encryption primitives and helper functions.
Functions
|
Decrypts a frame body. |
|
Encrypts a frame body. |
Classes
|
Abstract decryption handler. |
|
Abstract encryption handler. |
- class aws_encryption_sdk.internal.crypto.encryption.Encryptor(algorithm, key, associated_data, iv)
Bases:
object
Abstract encryption handler.
- Parameters
Prepares initial values.
- update(plaintext)
Updates _encryptor with provided plaintext.
- aws_encryption_sdk.internal.crypto.encryption.encrypt(algorithm, key, plaintext, associated_data, iv)
Encrypts a frame body.
- Parameters
- Returns
Deserialized object containing encrypted body
- Return type
- class aws_encryption_sdk.internal.crypto.encryption.Decryptor(algorithm, key, associated_data, iv, tag)
Bases:
object
Abstract decryption handler.
- Parameters
algorithm (aws_encryption_sdk.identifiers.Algorithm) – Algorithm used to encrypt this body
key (bytes) – Raw source key
associated_data (bytes) – Associated Data to send to decryption subsystem
iv (bytes) – IV value with which to initialize decryption subsystem
tag (bytes) – Tag with which to validate ciphertext
Prepares initial values.
- update(ciphertext)
Updates _decryptor with provided ciphertext.
- aws_encryption_sdk.internal.crypto.encryption.decrypt(algorithm, key, encrypted_data, associated_data)
Decrypts a frame body.
- Parameters
algorithm (aws_encryption_sdk.identifiers.Algorithm) – Algorithm used to encrypt this body
key (bytes) – Plaintext data key
encrypted_data (
aws_encryption_sdk.internal.structures.EncryptedData
,aws_encryption_sdk.internal.structures.FrameBody
, oraws_encryption_sdk.internal.structures.MessageNoFrameBody
) – EncryptedData containing body dataassociated_data (bytes) – AAD string generated for body
- Returns
Plaintext of body
- Return type