/var/opt/nydus/ops/oscrypto/_mac/__pycache__
Edit: /var/opt/nydus/ops/oscrypto/_mac/__pycache__/symmetric.cpython-312.pyc (23859B)
NjT 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_literalsdivisionabsolute_importprint_function )pretty_message)newnull )CoreFoundation CFHelpershandle_cf_error)Security)
rand_bytes) type_namebyte_cls)aes_cbc_no_padding_decryptaes_cbc_no_padding_encryptaes_cbc_pkcs7_decryptaes_cbc_pkcs7_encryptdes_cbc_pkcs5_decryptdes_cbc_pkcs5_encryptrc2_cbc_pkcs5_decryptrc2_cbc_pkcs5_encryptrc4_decryptrc4_encrypttripledes_cbc_pkcs5_decrypttripledes_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 kSecAttrKeyTypeAESkSecPaddingNoneKeykeydataivs H/opt/nydus/tmp/pip-target-a90h98xg/lib/python/oscrypto/_mac/symmetric.pyr r s 2 3x|#
H
^ RB
G
4y2~
I
44c4XE`E`abb 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&