當前位置: 首頁>>代碼示例>>Python>>正文


Python Blowfish.MODE_CBC屬性代碼示例

本文整理匯總了Python中Crypto.Cipher.Blowfish.MODE_CBC屬性的典型用法代碼示例。如果您正苦於以下問題:Python Blowfish.MODE_CBC屬性的具體用法?Python Blowfish.MODE_CBC怎麽用?Python Blowfish.MODE_CBC使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在Crypto.Cipher.Blowfish的用法示例。


在下文中一共展示了Blowfish.MODE_CBC屬性的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: cookie_encode

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def cookie_encode(self, *ids):
        cookie = super(Authentication, self).cookie_encode(*ids)

        bs = Blowfish.block_size
        iv = Random.new().read(bs)
        cipher = Blowfish.new(self.KEY, Blowfish.MODE_CBC, iv)
        # pad cookie to block size.
        # Cookie is ascii base64 + ':', so we can safely pad with '@'.
        missing_bytes = bs - (len(cookie) % bs)
        cookie += '@' * missing_bytes

        return '%s:%s' % (
            b64encode(iv),
            b64encode(cipher.encrypt(cookie))
        )

        return cookie 
開發者ID:Net-ng,項目名稱:kansha,代碼行數:19,代碼來源:security.py

示例2: run

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def run(self, module):
        if not HAVE_PYCRYPTO:
            module.log('warning', 'thoughtcrime: missing dependency: pycrypto')
            return None

        if self.zipfile and 'res/raw/blfs.key' in self.zipfile.namelist() and 'res/raw/config.cfg' in self.zipfile.namelist():
            iv = "12345678"  # this has to be done better
            key = self.zipfile.open('res/raw/blfs.key').read()
            key = ''.join(['%x' % ord(x) for x in key])[0:50]
            cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv)
            decode = base64.b64decode(self.zipfile.open('res/raw/config.cfg').read())
            config = cipher.decrypt(decode)
            config = config[:config.find('</config>') + 9]
            config = ET.fromstring(config)
            c2 = config.findall('.//data')[0].get('url_main').split(';')
            phone = config.findall('.//data')[0].get('phone_number')

            module.add_ioc(c2, ['thoughtcrime', 'c2'])

            return json.dumps({'c2': c2, 'phone': phone}, indent=2)
        else:
            return None 
開發者ID:certsocietegenerale,項目名稱:fame_modules,代碼行數:24,代碼來源:thoughtcrime.py

示例3: cookie_decode

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def cookie_decode(self, cookie):
        try:
            a_iv, token = cookie.split(':')
            iv = b64decode(a_iv)
            cipher = Blowfish.new(self.KEY, Blowfish.MODE_CBC, iv)
            cookie = cipher.decrypt(b64decode(token)).replace('@','')
        except ValueError:
            return (None, None)

        return super(Authentication, self).cookie_decode(cookie) 
開發者ID:Net-ng,項目名稱:kansha,代碼行數:12,代碼來源:security.py

示例4: extract

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def extract(self):
		raw_resources = filter(lambda x: x.startswith('res/raw'), self.zipfile.namelist())
		iv = "12345678" # this has to be done better
		key = self.zipfile.open('res/raw/blfs.key').read()
		key = ''.join(['%x' % ord(x) for x in key])[0:50]
		cipher = Blowfish.new(key, Blowfish.MODE_CBC, iv)
		decode = base64.b64decode(self.zipfile.open('res/raw/config.cfg').read())
		config = cipher.decrypt(decode)
		config = config[:config.find('</config>')+9]
		config = ET.fromstring(config)
		c2 = config.findall('.//data')[0].get('url_main').split(';')
		phone = config.findall('.//data')[0].get('phone_number')
		return {'c2': c2, 'phone': phone} 
開發者ID:maldroid,項目名稱:maldrolyzer,代碼行數:15,代碼來源:thoughtcrime.py

示例5: encrypt

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def encrypt(self, key, iv, plaintext):
        cipher = Blowfish.new(key=key[:self.keysize_bytes], IV=iv, mode=Blowfish.MODE_CBC)
        ciphertext = cipher.encrypt(plaintext)
        return ciphertext 
開發者ID:0xa,項目名稱:pyopenvpn,代碼行數:6,代碼來源:data_channel.py

示例6: decrypt

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def decrypt(self, key, iv, ciphertext):
        cipher = Blowfish.new(key=key[:self.keysize_bytes], IV=iv, mode=Blowfish.MODE_CBC)
        plaintext = cipher.decrypt(ciphertext)
        return plaintext 
開發者ID:0xa,項目名稱:pyopenvpn,代碼行數:6,代碼來源:data_channel.py

示例7: des_encrypt

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def des_encrypt(
        self,
        key: str,
        iv: str = "0000000000000000",
        mode: str = "CBC",
        hex_key: bool = False,
        hex_iv: bool = True,
    ):
        """Encrypt raw state with DES

        DES is a previously dominant algorithm for encryption, and was published 
        as an official U.S. Federal Information Processing Standard (FIPS). It is 
        now considered to be insecure due to its small key size. DES uses a key 
        length of 8 bytes (64 bits).<br>Triple DES uses a key length of 24 bytes. 
        You can generate a password-based key using one of the KDF operations. 
        The Initialization Vector should be 8 bytes long. If not entered, it will 
        default to 8 null bytes. Padding: In CBC and ECB mode, PKCS#7 padding will be used.
        
        Args:
            key (str): Required. The secret key
            iv (str, optional): IV for certain modes only. Defaults to '0000000000000000'.
            mode (str, optional): Encryption mode. Defaults to 'CBC'.
            hex_key (bool, optional): If the secret key is a hex string. Defaults to False.
            hex_iv (bool, optional): If the IV is a hex string. Defaults to True.
        
        Returns:
            Chepy: The Chepy object. 

        Examples:
            >>> Chepy("some data").des_encrypt("70617373776f7264", hex_key=True).o
            b"1ee5cb52954b211d1acd6e79c598baac"

            To encrypt using a differnt mode

            >>> Chepy("some data").des_encrypt("password", mode="CTR").o
            b"0b7399049b0267d93d"
        """

        self.__check_mode(mode)

        key, iv = self._convert_key(key, iv, hex_key, hex_iv)

        if mode == "CBC":
            cipher = DES.new(key, mode=DES.MODE_CBC, iv=iv)
            self.state = cipher.encrypt(pad(self._convert_to_bytes(), 8))
            return self
        elif mode == "ECB":
            cipher = DES.new(key, mode=DES.MODE_ECB)
            self.state = cipher.encrypt(pad(self._convert_to_bytes(), 8))
            return self
        elif mode == "CTR":
            cipher = DES.new(key, mode=DES.MODE_CTR, nonce=b"")
            self.state = cipher.encrypt(self._convert_to_bytes())
            return self
        elif mode == "OFB":
            cipher = DES.new(key, mode=DES.MODE_OFB, iv=iv)
            self.state = cipher.encrypt(self._convert_to_bytes())
            return self 
開發者ID:securisec,項目名稱:chepy,代碼行數:60,代碼來源:encryptionencoding.py

示例8: des_decrypt

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def des_decrypt(
        self,
        key: str,
        iv: str = "0000000000000000",
        mode: str = "CBC",
        hex_key: bool = False,
        hex_iv: bool = True,
    ):
        """Decrypt raw state encrypted with DES. 

        DES is a previously dominant algorithm for encryption, and was published 
        as an official U.S. Federal Information Processing Standard (FIPS). It is 
        now considered to be insecure due to its small key size. DES uses a key 
        length of 8 bytes (64 bits).<br>Triple DES uses a key length of 24 bytes. 
        You can generate a password-based key using one of the KDF operations. 
        The Initialization Vector should be 8 bytes long. If not entered, it will 
        default to 8 null bytes. Padding: In CBC and ECB mode, PKCS#7 padding will be used.
        
        Args:
            key (str): Required. The secret key
            iv (str, optional): IV for certain modes only. Defaults to '0000000000000000'.
            mode (str, optional): Encryption mode. Defaults to 'CBC'.
            hex_key (bool, optional): If the secret key is a hex string. Defaults to False.
            hex_iv (bool, optional): If the IV is a hex string. Defaults to True.
        
        Returns:
            Chepy: The Chepy object. 

        Examples:
            >>> Chepy("1ee5cb52954b211d1acd6e79c598baac").hex_to_str().des_decrypt("password").o
            b"some data"
        """

        self.__check_mode(mode)

        key, iv = self._convert_key(key, iv, hex_key, hex_iv)

        if mode == "CBC":
            cipher = DES.new(key, mode=DES.MODE_CBC, iv=iv)
            self.state = unpad(cipher.decrypt(self._convert_to_bytes()), 8)
            return self
        elif mode == "ECB":
            cipher = DES.new(key, mode=DES.MODE_ECB)
            self.state = unpad(cipher.decrypt(self._convert_to_bytes()), 8)
            return self
        elif mode == "CTR":
            cipher = DES.new(key, mode=DES.MODE_CTR, nonce=b"")
            self.state = cipher.decrypt(self._convert_to_bytes())
            return self
        elif mode == "OFB":
            cipher = DES.new(key, mode=DES.MODE_OFB, iv=iv)
            self.state = cipher.decrypt(self._convert_to_bytes())
            return self 
開發者ID:securisec,項目名稱:chepy,代碼行數:55,代碼來源:encryptionencoding.py

示例9: triple_des_encrypt

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def triple_des_encrypt(
        self,
        key: str,
        iv: str = "0000000000000000",
        mode: str = "CBC",
        hex_key: bool = False,
        hex_iv: bool = True,
    ):
        """Encrypt raw state with Triple DES

        Triple DES applies DES three times to each block to increase key size. Key: 
        Triple DES uses a key length of 24 bytes (192 bits).<br>DES uses a key length 
        of 8 bytes (64 bits).<br><br>You can generate a password-based key using one 
        of the KDF operations. IV: The Initialization Vector should be 8 bytes long. 
        If not entered, it will default to 8 null bytes. Padding: In CBC and ECB 
        mode, PKCS#7 padding will be used.
        
        Args:
            key (str): Required. The secret key
            iv (str, optional): IV for certain modes only. Defaults to '0000000000000000'.
            mode (str, optional): Encryption mode. Defaults to 'CBC'.
            hex_key (bool, optional): If the secret key is a hex string. Defaults to False.
            hex_iv (bool, optional): If the IV is a hex string. Defaults to True.
        
        Returns:
            Chepy: The Chepy object. 

        Examples:
            >>> Chepy("some data").triple_des_encrypt("super secret password !!", mode="ECB").o
            b"f8b27a0d8c837edc8fb00ea85f502fb4"
        """

        self.__check_mode(mode)

        key, iv = self._convert_key(key, iv, hex_key, hex_iv)

        if mode == "CBC":
            cipher = DES3.new(key, mode=DES3.MODE_CBC, iv=iv)
            self.state = cipher.encrypt(pad(self._convert_to_bytes(), 8))
            return self
        elif mode == "ECB":
            cipher = DES3.new(key, mode=DES3.MODE_ECB)
            self.state = cipher.encrypt(pad(self._convert_to_bytes(), 8))
            return self
        elif mode == "CTR":
            cipher = DES3.new(key, mode=DES3.MODE_CTR, nonce=b"")
            self.state = cipher.encrypt(self._convert_to_bytes())
            return self
        elif mode == "OFB":
            cipher = DES3.new(key, mode=DES3.MODE_OFB, iv=iv)
            self.state = cipher.encrypt(self._convert_to_bytes())
            return self 
開發者ID:securisec,項目名稱:chepy,代碼行數:54,代碼來源:encryptionencoding.py

示例10: triple_des_decrypt

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def triple_des_decrypt(
        self,
        key: str,
        iv: str = "0000000000000000",
        mode: str = "CBC",
        hex_key: bool = False,
        hex_iv: bool = True,
    ):
        """Decrypt raw state encrypted with DES. 

        Triple DES applies DES three times to each block to increase key size. Key: 
        Triple DES uses a key length of 24 bytes (192 bits).<br>DES uses a key length 
        of 8 bytes (64 bits).<br><br>You can generate a password-based key using one 
        of the KDF operations. IV: The Initialization Vector should be 8 bytes long. 
        If not entered, it will default to 8 null bytes. Padding: In CBC and ECB 
        mode, PKCS#7 padding will be used.
        
        Args:
            key (str): Required. The secret key
            iv (str, optional): IV for certain modes only. Defaults to '0000000000000000'.
            mode (str, optional): Encryption mode. Defaults to 'CBC'.
            hex_key (bool, optional): If the secret key is a hex string. Defaults to False.
            hex_iv (bool, optional): If the IV is a hex string. Defaults to True.
        
        Returns:
            Chepy: The Chepy object. 

        Examples:
            >>> c = Chepy("f8b27a0d8c837edce87dd13a1ab41f96")
            >>> c.hex_to_str()
            >>> c.triple_des_decrypt("super secret password !!")
            >>> c.o
            b"some data"
        """

        self.__check_mode(mode)

        key, iv = self._convert_key(key, iv, hex_key, hex_iv)

        if mode == "CBC":
            cipher = DES3.new(key, mode=DES3.MODE_CBC, iv=iv)
            self.state = unpad(cipher.decrypt(self._convert_to_bytes()), 8)
            return self
        elif mode == "ECB":
            cipher = DES3.new(key, mode=DES3.MODE_ECB)
            self.state = unpad(cipher.decrypt(self._convert_to_bytes()), 8)
            return self
        elif mode == "CTR":
            cipher = DES3.new(key, mode=DES3.MODE_CTR, nonce=b"")
            self.state = cipher.decrypt(self._convert_to_bytes())
            return self
        elif mode == "OFB":
            cipher = DES3.new(key, mode=DES3.MODE_OFB, iv=iv)
            self.state = cipher.decrypt(self._convert_to_bytes())
            return self 
開發者ID:securisec,項目名稱:chepy,代碼行數:57,代碼來源:encryptionencoding.py

示例11: blowfish_encrypt

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def blowfish_encrypt(
        self,
        key: str,
        iv: str = "0000000000000000",
        mode: str = "CBC",
        hex_key: bool = False,
        hex_iv: bool = True,
    ):
        """Encrypt raw state with Blowfish

        Blowfish is a symmetric-key block cipher designed in 1993 by 
        Bruce Schneier and included in a large number of cipher suites 
        and encryption products. AES now receives more attention.
        IV: The Initialization Vector should be 8 bytes long.

        Args:
            key (str): Required. The secret key
            iv (str, optional): IV for certain modes only. Defaults to '0000000000000000'.
            mode (str, optional): Encryption mode. Defaults to 'CBC'.
            hex_key (bool, optional): If the secret key is a hex string. Defaults to False.
            hex_iv (bool, optional): If the IV is a hex string. Defaults to True.
        
        Returns:
            Chepy: The Chepy object. 

        Examples:
            >>> Chepy("some data").blowfish_encrypt("password", mode="ECB").o
            b"d9b0a79853f139603951bff96c3d0dd5"
        """

        self.__check_mode(mode)

        key, iv = self._convert_key(key, iv, hex_key, hex_iv)

        if mode == "CBC":
            cipher = Blowfish.new(key, mode=Blowfish.MODE_CBC, iv=iv)
            self.state = cipher.encrypt(pad(self._convert_to_bytes(), 8))
            return self
        elif mode == "ECB":
            cipher = Blowfish.new(key, mode=Blowfish.MODE_ECB)
            self.state = cipher.encrypt(pad(self._convert_to_bytes(), 8))
            return self
        elif mode == "CTR":
            cipher = Blowfish.new(key, mode=Blowfish.MODE_CTR, nonce=b"")
            self.state = cipher.encrypt(self._convert_to_bytes())
            return self
        elif mode == "OFB":
            cipher = Blowfish.new(key, mode=Blowfish.MODE_OFB, iv=iv)
            self.state = cipher.encrypt(self._convert_to_bytes())
            return self 
開發者ID:securisec,項目名稱:chepy,代碼行數:52,代碼來源:encryptionencoding.py

示例12: populate_transform_menu

# 需要導入模塊: from Crypto.Cipher import Blowfish [as 別名]
# 或者: from Crypto.Cipher.Blowfish import MODE_CBC [as 別名]
def populate_transform_menu(menu, obj, action_table):
	aes_menu = menu.addMenu("AES")
	aes_ecb_menu = aes_menu.addMenu("ECB mode")
	aes_cbc_menu = aes_menu.addMenu("CBC mode")
	action_table[aes_ecb_menu.addAction("Encrypt")] = lambda: obj.transform_with_key(lambda data, key: aes_encrypt_transform(data, key, AES.MODE_ECB, ""))
	action_table[aes_ecb_menu.addAction("Decrypt")] = lambda: obj.transform_with_key(lambda data, key: aes_decrypt_transform(data, key, AES.MODE_ECB, ""))
	action_table[aes_cbc_menu.addAction("Encrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: aes_encrypt_transform(data, key, AES.MODE_CBC, iv))
	action_table[aes_cbc_menu.addAction("Decrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: aes_decrypt_transform(data, key, AES.MODE_CBC, iv))

	blowfish_menu = menu.addMenu("Blowfish")
	blowfish_ecb_menu = blowfish_menu.addMenu("ECB mode")
	blowfish_cbc_menu = blowfish_menu.addMenu("CBC mode")
	action_table[blowfish_ecb_menu.addAction("Encrypt")] = lambda: obj.transform_with_key(lambda data, key: blowfish_encrypt_transform(data, key, Blowfish.MODE_ECB, ""))
	action_table[blowfish_ecb_menu.addAction("Decrypt")] = lambda: obj.transform_with_key(lambda data, key: blowfish_decrypt_transform(data, key, Blowfish.MODE_ECB, ""))
	action_table[blowfish_cbc_menu.addAction("Encrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: blowfish_encrypt_transform(data, key, Blowfish.MODE_CBC, iv))
	action_table[blowfish_cbc_menu.addAction("Decrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: blowfish_decrypt_transform(data, key, Blowfish.MODE_CBC, iv))

	cast_menu = menu.addMenu("CAST")
	cast_ecb_menu = cast_menu.addMenu("ECB mode")
	cast_cbc_menu = cast_menu.addMenu("CBC mode")
	action_table[cast_ecb_menu.addAction("Encrypt")] = lambda: obj.transform_with_key(lambda data, key: cast_encrypt_transform(data, key, CAST.MODE_ECB, ""))
	action_table[cast_ecb_menu.addAction("Decrypt")] = lambda: obj.transform_with_key(lambda data, key: cast_decrypt_transform(data, key, CAST.MODE_ECB, ""))
	action_table[cast_cbc_menu.addAction("Encrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: cast_encrypt_transform(data, key, CAST.MODE_CBC, iv))
	action_table[cast_cbc_menu.addAction("Decrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: cast_decrypt_transform(data, key, CAST.MODE_CBC, iv))

	des_menu = menu.addMenu("DES")
	des_ecb_menu = des_menu.addMenu("ECB mode")
	des_cbc_menu = des_menu.addMenu("CBC mode")
	action_table[des_ecb_menu.addAction("Encrypt")] = lambda: obj.transform_with_key(lambda data, key: des_encrypt_transform(data, key, DES.MODE_ECB, ""))
	action_table[des_ecb_menu.addAction("Decrypt")] = lambda: obj.transform_with_key(lambda data, key: des_decrypt_transform(data, key, DES.MODE_ECB, ""))
	action_table[des_cbc_menu.addAction("Encrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: des_encrypt_transform(data, key, DES.MODE_CBC, iv))
	action_table[des_cbc_menu.addAction("Decrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: des_decrypt_transform(data, key, DES.MODE_CBC, iv))

	des3_menu = menu.addMenu("Triple DES")
	des3_ecb_menu = des3_menu.addMenu("ECB mode")
	des3_cbc_menu = des3_menu.addMenu("CBC mode")
	action_table[des3_ecb_menu.addAction("Encrypt")] = lambda: obj.transform_with_key(lambda data, key: des3_encrypt_transform(data, key, DES3.MODE_ECB, ""))
	action_table[des3_ecb_menu.addAction("Decrypt")] = lambda: obj.transform_with_key(lambda data, key: des3_decrypt_transform(data, key, DES3.MODE_ECB, ""))
	action_table[des3_cbc_menu.addAction("Encrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: des3_encrypt_transform(data, key, DES3.MODE_CBC, iv))
	action_table[des3_cbc_menu.addAction("Decrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: des3_decrypt_transform(data, key, DES3.MODE_CBC, iv))

	rc2_menu = menu.addMenu("RC2")
	rc2_ecb_menu = rc2_menu.addMenu("ECB mode")
	rc2_cbc_menu = rc2_menu.addMenu("CBC mode")
	action_table[rc2_ecb_menu.addAction("Encrypt")] = lambda: obj.transform_with_key(lambda data, key: rc2_encrypt_transform(data, key, ARC2.MODE_ECB, ""))
	action_table[rc2_ecb_menu.addAction("Decrypt")] = lambda: obj.transform_with_key(lambda data, key: rc2_decrypt_transform(data, key, ARC2.MODE_ECB, ""))
	action_table[rc2_cbc_menu.addAction("Encrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: rc2_encrypt_transform(data, key, ARC2.MODE_CBC, iv))
	action_table[rc2_cbc_menu.addAction("Decrypt")] = lambda: obj.transform_with_key_and_iv(lambda data, key, iv: rc2_decrypt_transform(data, key, ARC2.MODE_CBC, iv))

	action_table[menu.addAction("RC4")] = lambda: obj.transform_with_key(lambda data, key: rc4_transform(data, key))
	action_table[menu.addAction("XOR")] = lambda: obj.transform_with_key(lambda data, key: xor_transform(data, key)) 
開發者ID:Vector35,項目名稱:deprecated-binaryninja-python,代碼行數:53,代碼來源:Transform.py


注:本文中的Crypto.Cipher.Blowfish.MODE_CBC屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。