hyb
2026-01-30 44480e71b27aa9d4cb8441f50c873f1b110e9691
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Ë
ž¬`i­+ãó|—dZdgZddlmZddlmZmZmZmZm    Z    m
Z
m Z m Z ddl mZedd«ZGd„de«Zd    „Zy
) z'
Ciphertext Block Chaining (CBC) mode.
ÚCbcModeé)Ú _copy_bytes)Úload_pycryptodome_raw_libÚ VoidPointerÚcreate_string_bufferÚget_raw_bufferÚ SmartPointerÚc_size_tÚ c_uint8_ptrÚis_writeable_buffer)Úget_random_byteszCrypto.Cipher._raw_cbca®
                int CBC_start_operation(void *cipher,
                                        const uint8_t iv[],
                                        size_t iv_len,
                                        void **pResult);
                int CBC_encrypt(void *cbcState,
                                const uint8_t *in,
                                uint8_t *out,
                                size_t data_len);
                int CBC_decrypt(void *cbcState,
                                const uint8_t *in,
                                uint8_t *out,
                                size_t data_len);
                int CBC_stop_operation(void *state);
                có&—eZdZdZd„Zdd„Zdd„Zy)ra[*Cipher-Block Chaining (CBC)*.
 
    Each of the ciphertext blocks depends on the current
    and all previous plaintext blocks.
 
    An Initialization Vector (*IV*) is required.
 
    See `NIST SP800-38A`_ , Section 6.2 .
 
    .. _`NIST SP800-38A` : http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
 
    :undocumented: __init__
    c    ó—t«|_tj|j    «t |«t t|««|jj««}|rtd|z«‚t|jj    «tj«|_|j«t|«|_     tdd|«|_    |j|_    ddg|_y)aCreate a new block cipher, configured in CBC mode.
 
        :Parameters:
          block_cipher : C pointer
            A smart pointer to the low-level block cipher instance.
 
          iv : bytes/bytearray/memoryview
            The initialization vector to use for encryption or decryption.
            It is as long as the cipher block.
 
            **The IV must be unpredictable**. Ideally it is picked randomly.
 
            Reusing the *IV* for encryptions performed with the same key
            compromises confidentiality.
        z)Error %d while instantiating the CBC modeNÚencryptÚdecrypt)rÚ_stateÚ raw_cbc_libÚCBC_start_operationÚgetr r
ÚlenÚ
address_ofÚ
ValueErrorr    ÚCBC_stop_operationÚreleaseÚ
block_sizerÚivÚIVÚ_next)ÚselfÚ block_cipherrÚresults    õjH:\项目\archive\测试组\脚本\Change_password\venv_build\Lib\site-packages\Crypto/Cipher/_mode_cbc.pyÚ__init__zCbcMode.__init__Nsۀô""“mˆŒ Ü×0Ñ0°×1AÑ1AÓ1CÜ1<¸R³Ü19¼#¸b»'Ó1BØ15·±×1GÑ1GÓ1IóKˆñ ÜÐHØ%ñ&ó'ð 'ô
# 4§;¡;§?¡?Ó#4Ü#.×#AÑ#AóCˆŒ ð
    ×ÑÔä˜b›'ˆŒØ@ä˜d D¨"Ó-ˆŒð    &ð—'‘'ˆŒØà Ð+ˆ
óNc
ó—d|jvr td«‚dg|_|€tt|««}nF|}t    |«s td«‚t|«t|«k7rt dt|«z«‚t j|jj«t|«t|«tt|«««}|r+|dk(rt d|jz«‚t d|z«‚|€ t|«Sy)    aŽEncrypt data with the key and the parameters set at initialization.
 
        A cipher object is stateful: once you have encrypted a message
        you cannot encrypt (or decrypt) another message using the same
        object.
 
        The data to encrypt can be broken up in two or
        more pieces and `encrypt` can be called multiple times.
 
        That is, the statement:
 
            >>> c.encrypt(a) + c.encrypt(b)
 
        is equivalent to:
 
             >>> c.encrypt(a+b)
 
        That also means that you cannot reuse an object for encrypting
        or decrypting other data with the same key.
 
        This function does not add any padding to the plaintext.
 
        :Parameters:
          plaintext : bytes/bytearray/memoryview
            The piece of data to encrypt.
            Its lenght must be multiple of the cipher block size.
        :Keywords:
          output : bytearray/memoryview
            The location where the ciphertext must be written to.
            If ``None``, the ciphertext is returned.
        :Return:
          If ``output`` is ``None``, the ciphertext is returned as ``bytes``.
          Otherwise, ``None``.
        rz*encrypt() cannot be called after decrypt()Nú4output must be a bytearray or a writeable memoryviewú9output must have the same length as the input  (%d bytes)éú3Data must be padded to %d byte boundary in CBC modez%Error %d while encrypting in CBC mode)rÚ    TypeErrorrrr rrÚ CBC_encryptrrr r
rr)rÚ    plaintextÚoutputÚ
ciphertextr!s     r"rzCbcMode.encrypt}s€ðH ˜DŸJ™JÑ &ÜÐHÓIÐ Iؐ[ˆŒ
à ˆ>Ü-¬c°)«nÓ=‰JàˆJä& vÔ.ÜРVÓWÐWä9‹~¤ V£Ò,Ü ð"0Ü25°i³.ñ"AóBðBô×(Ñ(¨¯©¯©Ó):Ü)4°YÓ)?Ü)4°ZÓ)@Ü)1´#°i³.Ó)AóCˆñ ؘŠ{Ü Ð!VÐY]×YhÑYhÑ!hÓiÐiÜÐDÀvÑMÓNÐ Nà ˆ>Ü! *Ó-Ð -àr$c
ó—d|jvr td«‚dg|_|€tt|««}nF|}t    |«s td«‚t|«t|«k7rt dt|«z«‚t j|jj«t|«t|«tt|«««}|r+|dk(rt d|jz«‚t d|z«‚|€ t|«Sy)    aDecrypt data with the key and the parameters set at initialization.
 
        A cipher object is stateful: once you have decrypted a message
        you cannot decrypt (or encrypt) another message with the same
        object.
 
        The data to decrypt can be broken up in two or
        more pieces and `decrypt` can be called multiple times.
 
        That is, the statement:
 
            >>> c.decrypt(a) + c.decrypt(b)
 
        is equivalent to:
 
             >>> c.decrypt(a+b)
 
        This function does not remove any padding from the plaintext.
 
        :Parameters:
          ciphertext : bytes/bytearray/memoryview
            The piece of data to decrypt.
            Its length must be multiple of the cipher block size.
        :Keywords:
          output : bytearray/memoryview
            The location where the plaintext must be written to.
            If ``None``, the plaintext is returned.
        :Return:
          If ``output`` is ``None``, the plaintext is returned as ``bytes``.
          Otherwise, ``None``.
        rz*decrypt() cannot be called after encrypt()Nr&r'r(r)z%Error %d while decrypting in CBC mode)rr*rrr rrÚ CBC_decryptrrr r
rr)rr.r-r,r!s     r"rzCbcMode.decrypt¿s€ðB ˜DŸJ™JÑ &ÜÐHÓIÐ Iؐ[ˆŒ
à ˆ>Ü,¬S°«_Ó=‰IàˆIä& vÔ.ÜРVÓWÐWä:‹¤# f£+Ò-Ü ð"0Ü25°i³.ñ"AóBðBô×(Ñ(¨¯©¯©Ó):Ü)4°ZÓ)@Ü)4°YÓ)?Ü)1´#°j³/Ó)BóDˆñ ؘŠ{Ü Ð!VÐY]×YhÑYhÑ!hÓiÐiÜÐDÀvÑMÓNÐ Nà ˆ>Ü! )Ó,Ð ,àr$)N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__r#rr©r$r"rr?s„ñ ò-,ó^@ôD=r$c óp—|j|«}|jdd«}|jdd«}d||fk(rt|j«}| | t    d«‚|}t |«|jk7rt d|jz«‚|rt    dt|«z«‚t||«S)aóInstantiate a cipher object that performs CBC encryption/decryption.
 
    :Parameters:
      factory : module
        The underlying block cipher, a module from ``Crypto.Cipher``.
 
    :Keywords:
      iv : bytes/bytearray/memoryview
        The IV to use for CBC.
 
      IV : bytes/bytearray/memoryview
        Alias for ``iv``.
 
    Any other keyword will be passed to the underlying block cipher.
    See the relevant documentation for details (at least ``key`` will need
    to be present).
    rNr)NNz*You must either use 'iv' or 'IV', not bothz.Incorrect IV length (it must be %d bytes long)zUnknown parameters for CBC: %s)    Ú_create_base_cipherÚpopr rr*rrÚstrr)ÚfactoryÚkwargsÚ cipher_staterrs     r"Ú_create_cbc_cipherr=ÿs€ð&×.Ñ.¨vÓ6€LØ    ‰D˜$Ó    €BØ    ‰D˜$Ó    €Bà˜˜BxÒÜ ˜g×0Ñ0Ó 1ˆØ    €~Ø ˆ>ÜÐHÓIÐ Ià ˆä
ˆ2ƒw'×$Ñ$Ò$ÜÐIØ ×+Ñ+ñ,ó-ð    -ñÜÐ8¼3¸v»;ÑFÓGÐGä < Ó $Ð$r$N)r4Ú__all__ÚCrypto.Util.py3compatrÚCrypto.Util._raw_apirrrrr    r
r r Ú Crypto.Randomr rÚobjectrr=r5r$r"ú<module>rCsQðñ>ð ˆ+€å-÷7÷7ó7õ
+á'Ð(@ðCó€ ô$}ˆfô}ó@&%r$