📜  python DES - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:27.128000             🧑  作者: Mango

代码示例1
from Crypto.Cipher import DES
from Crypto import Random
iv = Random.get_random_bytes(8)
des1 = DES.new('01234567', DES.MODE_CFB, iv)
des2 = DES.new('01234567', DES.MODE_CFB, iv)
text = 'Good Morning'
cipher_text = des1.encrypt(text)
print("Encrpted message ",cipher_text) 
print("Decrypted Original Message: ",(des2.decrypt(cipher_text)))