✏️ 正在编辑: symmetric.cpython-312.pyc
路径:
/var/opt/nydus/ops/oscrypto/_mac/__pycache__/symmetric.cpython-312.pyc
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
� ��'j�T � �� � d dl mZmZmZmZ ddlmZ ddlmZm Z ddl mZmZm Z ddlmZ ddlmZ dd lmZmZ g d �Zd� Zd� Zd � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d� Z"d� Z#y)� )�unicode_literals�division�absolute_import�print_function� )�pretty_message)�new�null� )�CoreFoundation� CFHelpers�handle_cf_error)�Security)� rand_bytes)� type_name�byte_cls)�aes_cbc_no_padding_decrypt�aes_cbc_no_padding_encrypt�aes_cbc_pkcs7_decrypt�aes_cbc_pkcs7_encrypt�des_cbc_pkcs5_decrypt�des_cbc_pkcs5_encrypt�rc2_cbc_pkcs5_decrypt�rc2_cbc_pkcs5_encrypt�rc4_decrypt�rc4_encrypt�tripledes_cbc_pkcs5_decrypt�tripledes_cbc_pkcs5_encryptc � � t | � dvrt t dt | � � � �|st d� }n,t |� dk7 rt t dt |� � � �t |� dz dk7 rt t dt |� � � �|t t j | ||t j � fS )a� Encrypts plaintext using AES in CBC mode with a 128, 192 or 256 bit key and no padding. This means the ciphertext must be an exact multiple of 16 bytes long. :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The plaintext - a byte string :param iv: The initialization vector - either a byte string 16-bytes long or None to generate an IV :raises: ValueError - when any of the parameters contain an invalid value TypeError - when any of the parameters are of the wrong type OSError - when an error is returned by the OS crypto library :return: A tuple of two byte strings (iv, ciphertext) �� � � �c key must be either 16, 24 or 32 bytes (128, 192 or 256 bits) long - is %s r! �: iv must be 16 bytes long - is %s r zJ data must be a multiple of 16 bytes long - is %s )�len� ValueErrorr r �_encryptr �kSecAttrKeyTypeAES�kSecPaddingNoneKey��key�data�ivs �H/opt/nydus/tmp/pip-target-k0fmikie/lib/python/oscrypto/_mac/symmetric.pyr r s� � �2 �3�x�|�#��� � ��H� � � � � ��^�� �R��B���� � ��G� � � � �4�y�2�~����� � ��I� � � � ���4�4�c�4��X�E`�E`�a�b�b� c � � t | � dvrt t dt | � � � �t |� dk7 rt t dt |� � � �t t j | ||t j � S )a[ Decrypts AES ciphertext in CBC mode using a 128, 192 or 256 bit key and no padding. :param key: The encryption key - a byte string either 16, 24 or 32 bytes long :param data: The ciphertext - a byte string :param iv: The initialization vector - a byte string 16-bytes long :raises: ValueError - when any of the parameters contain an invalid value TypeError - when any of the parameters are of the wrong type OSError - when an error is returned by the OS crypto library :return: A byte string of the plaintext r r$ r! r% )r&