encryption.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:aws-encryption-sdk-python 作者: awslabs 项目源码 文件源码
def __init__(self, algorithm, key, associated_data, iv):
        """Prepares initial values."""
        self.source_key = key

        # Construct an encryptor object with the given key and a provided IV.
        # This is intentionally generic to leave an option for non-Cipher encryptor types in the future.
        self.iv = iv
        self._encryptor = Cipher(
            algorithm.encryption_algorithm(key),
            algorithm.encryption_mode(self.iv),
            backend=default_backend()
        ).encryptor()

        # associated_data will be authenticated but not encrypted,
        # it must also be passed in on decryption.
        self._encryptor.authenticate_additional_data(associated_data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号