<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                安裝依賴庫 ~~~ pip install pycryptodome ~~~ ~~~ from binascii import b2a_base64, a2b_base64 from Crypto.Cipher import AES class AES_CBC(): def __init__(self, key, iv): # key必須為16位字符串 self.key = bytes(key, encoding='utf-8') self.iv = bytes(iv, encoding='utf-8') # 加密。text:需要加密的內容 def encrypt(self, text): cryptor = AES.new(self.key, AES.MODE_CBC, self.iv) bs = 16 length = len(text) bytes_length = len(bytes(text, encoding='utf-8')) # tips:utf-8編碼時,英文占1個byte,而中文占3個byte padding_size = length if (bytes_length == length) else bytes_length padding = bs - padding_size % bs # tips:chr(padding)看與其它語言的約定,有的會使用'\0' padding_text = chr(padding) * padding text = text + padding_text ciphertext = cryptor.encrypt(bytes(text, encoding='utf-8')) return b2a_base64(ciphertext) # 解密 def decrypt(self, content): cipher = AES.new(self.key, AES.MODE_CBC, self.iv) encrypt_bytes = a2b_base64(content) decrypt_bytes = cipher.decrypt(encrypt_bytes) text = str(decrypt_bytes, encoding='utf-8') length = len(text) unpadding = ord(text[length-1]) return text[0:length-unpadding] ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看