本文整理汇总了Python中Crypto.Cipher.ARC2.new方法的典型用法代码示例。如果您正苦于以下问题:Python ARC2.new方法的具体用法?Python ARC2.new怎么用?Python ARC2.new使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crypto.Cipher.ARC2
的用法示例。
在下文中一共展示了ARC2.new方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runTest
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def runTest(self):
"""ARC2 with keylength > 128"""
key = "x" * 16384
mode = ARC2.MODE_ECB
self.assertRaises(ValueError, ARC2.new, key, mode)
示例2: aes_encrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def aes_encrypt_transform(data, key, mode, iv):
aes = AES.new(key, mode, iv)
return aes.encrypt(data)
示例3: aes_decrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def aes_decrypt_transform(data, key, mode, iv):
aes = AES.new(key, mode, iv)
return aes.decrypt(data)
示例4: blowfish_encrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def blowfish_encrypt_transform(data, key, mode, iv):
blowfish = Blowfish.new(key, mode, iv)
return blowfish.encrypt(data)
示例5: blowfish_decrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def blowfish_decrypt_transform(data, key, mode, iv):
blowfish = Blowfish.new(key, mode, iv)
return blowfish.decrypt(data)
示例6: cast_encrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def cast_encrypt_transform(data, key, mode, iv):
cast = CAST.new(key, mode, iv)
return cast.encrypt(data)
示例7: des_encrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def des_encrypt_transform(data, key, mode, iv):
des = DES.new(key, mode, iv)
return des.encrypt(data)
示例8: des_decrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def des_decrypt_transform(data, key, mode, iv):
des = DES.new(key, mode, iv)
return des.decrypt(data)
示例9: des3_encrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def des3_encrypt_transform(data, key, mode, iv):
des = DES3.new(key, mode, iv)
return des.encrypt(data)
示例10: des3_decrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def des3_decrypt_transform(data, key, mode, iv):
des = DES3.new(key, mode, iv)
return des.decrypt(data)
示例11: rc2_encrypt_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def rc2_encrypt_transform(data, key, mode, iv):
arc2 = ARC2.new(key, mode, iv)
return arc2.encrypt(data)
示例12: rc4_transform
# 需要导入模块: from Crypto.Cipher import ARC2 [as 别名]
# 或者: from Crypto.Cipher.ARC2 import new [as 别名]
def rc4_transform(data, key):
arc4 = ARC4.new(key)
return arc4.encrypt(data)